Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 25 Sep 2012 05:43:56 GMT
From:      Dave Yost <dave@yost.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   kern/171940: RFE: tty color features
Message-ID:  <201209250543.q8P5huiA044950@red.freebsd.org>
Resent-Message-ID: <201209250550.q8P5o7MS025195@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         171940
>Category:       kern
>Synopsis:       RFE: tty color features
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Tue Sep 25 05:50:07 UTC 2012
>Closed-Date:
>Last-Modified:
>Originator:     Dave Yost
>Release:        Mac OS X
>Organization:
>Environment:
Darwin ip2 12.2.0 Darwin Kernel Version 12.2.0: Sat Aug 25 00:48:52 PDT 2012; root:xnu-2050.18.24~1/RELEASE_X86_64 x86_64
>Description:
It would be nice to be able to specify fg/bg colors at the tty level, so that echoed characters can be colorized. Then your shell can arrange that echoed shell command input is one fg/bg color, and other input taken by commands run from the shell is another color.

>How-To-Repeat:

>Fix:
This is not a complete spec, only a sketch.

It would be nice to be able to specify fg/bg colors at the tty level, so that echoed characters can be colorized. Then your shell can arrange that shell command input is one fg/bg color, and other input taken by commands run from the shell is another color.

For example, like this:
 
  stty color-echo=#ffdddd/#000022 color-out=#ddffdd color-err=/#220000
  stty color-fd3=/#222255
  stty color-out=

or

  stty color-type=cmd:#ffdddd/#000000
  stty color-echo=cmd
  echo foo
  stty color-echo=#eeeeee
  echo bar
  stty color-echo=cmd
  echo baz

Names of things that can be colorized might include:
  echo
  out
  err
  fd0
  fd1
  fd2
  ...

I think named colors should be supported, with at least these builtin names:
  echo-default
  in-default
  out-default
This
  stty color-type=echo-default:
tells the tty driver that echo-default does no colorizing.

I used #xxxxxx notation as a placeholder. Probably in actual use, the user would supply a terminal escape sequence.

Typeahead is tricky:

  stty color-typeahead=#ff6666/004444

This would cause typeahead to be echoed in the desired color, and then when appropriate, typeahead characters could change color, such as when they are consumed or when they are hanging there with a pending cooked read.

>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201209250543.q8P5huiA044950>