+ Reply to Thread
Results 1 to 4 of 4

tcsh and colors

  1. tcsh and colors

    Hello,

    This may seems a little issue but it annoys me:

    I use tcsh (on Linux).

    in /root/.tcsh , I have
    set prompt = "%{\033[34m%}%B %m:%/%#%b "
    which sets the prompt to blue.

    changing it to
    set prompt = "%{\033[32m%}%B %m:%/%#%b"
    sets the prompt to green.

    set prompt = "%{\033[31m%}%B %m:%/%#%b"
    sets the prompt to green.

    But I don't have all the colors here; for example, I don't have
    **brown** where I can have brown in bash for example. And I am used to
    assign this color to a certain type of machine
    (I can have , as said, brown color in bash).

    >From where are these color definitions come ?

    Any suggestion what should I do to create a prompt in brown in tcsh ?

    Regards,
    Mark


  2. Re: tcsh and colors

    On Wed, 11 Jul 2007 13:38:15 -0000, markryde@gmail.com
    wrote:
    >
    >
    > Hello,
    >
    > This may seems a little issue but it annoys me:
    >
    > I use tcsh (on Linux).
    >
    > in /root/.tcsh , I have
    > set prompt = "%{\033[34m%}%B %m:%/%#%b "
    > which sets the prompt to blue.
    >
    > changing it to
    > set prompt = "%{\033[32m%}%B %m:%/%#%b"
    > sets the prompt to green.
    >
    > set prompt = "%{\033[31m%}%B %m:%/%#%b"
    > sets the prompt to green.
    >

    [31m is red on my machine. What terminal are you using? You can set
    background color with [4?m, or both at once with [3?;4?m.
    If you are using the text mode console, try "man console_codes". See
    below for xterm. Also, "man 5 terminfo" contains information about
    terminfo codes that can be used with the tput command.

    > But I don't have all the colors here; for example, I don't have
    > **brown** where I can have brown in bash for example. And I am used to
    > assign this color to a certain type of machine
    > (I can have , as said, brown color in bash).
    >
    >>From where are these color definitions come ?

    > Any suggestion what should I do to create a prompt in brown in tcsh ?
    >

    Look for a file called ctlseqs.ms.gz, which should be in
    /usr/share/doc/xterm. To get a readable form of this document, gunzip
    it and use groff -ms -Tascii (you must have the full groff package
    installed, not just groff-base). This contains more than you will ever
    want to know about xterm escape sequences, so search for the word
    "color".


    --
    "The wages of sin are death; but after they're done taking out taxes,
    it's just a tired feeling:"

  3. Re: tcsh and colors

    Bill Marcum wrote:
    >> But I don't have all the colors here; for example, I don't have
    >> **brown** where I can have brown in bash for example. And I am used to
    >> assign this color to a certain type of machine
    >> (I can have , as said, brown color in bash).
    >>
    >> From where are these color definitions come ?
    >> Any suggestion what should I do to create a prompt in brown in tcsh ?

    >
    > Look for a file called ctlseqs.ms.gz, which should be in
    > /usr/share/doc/xterm.


    See also:
    http://frexx.de/xterm-256-notes/

    ..which shows the 16 color mode common to most terminal programs
    (konsole/xterm/Terminal(OSX)/etc), and also describes how to enable
    the 256 color mode (special compile of xterm).

    I've found that some terminals show 'yellow' ([33m) as either
    orange, or in some cases 'brown'.

    The colors do not have anything to do with the shells, it has more
    to do with the terminal program's capabilities that you're viewing
    the shell with.

  4. Re: tcsh and colors

    Greg Ercolano wrote:
    > Bill Marcum wrote:
    >>> But I don't have all the colors here; for example, I don't have
    >>> **brown** where I can have brown in bash for example. And I am used to
    >>> assign this color to a certain type of machine
    >>> (I can have , as said, brown color in bash).
    >>>
    >>> From where are these color definitions come ?
    >>> Any suggestion what should I do to create a prompt in brown in tcsh ?

    >>
    >> Look for a file called ctlseqs.ms.gz, which should be in
    >> /usr/share/doc/xterm.


    It's in xterm's tar ball as well - see my webpage.

    > See also:
    > http://frexx.de/xterm-256-notes/


    > ..which shows the 16 color mode common to most terminal programs


    It's not (not "common to most"). The example there shows the effect of
    bold fonts on terminals that act like PC's (e.g., CGA/VGA displays).
    For example

    http://en.wikipedia.org/wiki/Color_Graphics_Adapter
    http://en.wikipedia.org/wiki/VGA

    (but keep in mind that wikipedia is not _authoritative_ - ctlseqs.ms
    on the other hand is...)

    It's no more a separate color than using the blinking attribute which
    happens to do something similar on some terminals. The same applies to
    other non-color video attributes such as underline - which are rendered
    as specific colors on terminals. From the application's viewpoint, it
    only knows that it requested a bold font.

    xterm does that, plus a 16-color mode (from aixterm).

    It's not in any standard, ANSI or otherwise (nor is the use of color to
    render non-color video attributes).

    I noticed recently that one of wikipedia's
    links contains that - and cites the aixterm sequences (incorrectly):

    http://en.wikipedia.org/wiki/ANSI_escape_code

    ( I repaired some of it ;-)

    --
    Thomas E. Dickey
    http://invisible-island.net
    ftp://invisible-island.net

+ Reply to Thread