Professional Web Applications Themes

xterm colour codes - Debian

I am trying to get my bash scripts to highlight some of their output in colour, a bit like ls --color It seems that I have to use ANSI esc sequences ... man xterm .. SEE ALSO resize(1), X(7), pty(4), tty(4) Xterm Control Sequences (this is the file ctlseqs.ms). [url]http://ey.his.com/xterm/xterm.html[/url] I cant find the control sequences doent ctlseqs.ms, though I have searched the system as root for it. Google suggested <esc>[33] .. for yellow I tried various forms, it just prints the string ... Any ideas guys .. some of those error messages would look great in colour Dave -- ...

  1. #1

    Default xterm colour codes

    I am trying to get my bash scripts to highlight some of their output in
    colour, a bit like ls --color
    It seems that I have to use ANSI esc sequences ...

    man xterm ..

    SEE ALSO
    resize(1), X(7), pty(4), tty(4)
    Xterm Control Sequences (this is the file ctlseqs.ms).

    [url]http://ey.his.com/xterm/xterm.html[/url]

    I cant find the control sequences doent ctlseqs.ms, though I have
    searched the system as root for it.

    Google suggested
    <esc>[33] .. for yellow

    I tried various forms, it just prints the string ...
    Any ideas guys .. some of those error messages would look great in colour

    Dave


    --
    To UNSUBSCRIBE, email to [email]debian-user-requestlists.debian.org[/email]
    with a subject of "unsubscribe". Trouble? Contact [email]listmasterlists.debian.org[/email]
    David selby Guest

  2. #2

    Default Re: xterm colour codes

    On Wed, Jul 23, 2003 at 09:44:57AM +0100, David selby wrote:
    > I cant find the control sequences doent ctlseqs.ms, though I have
    > searched the system as root for it.
    ..ms is the source form (it's a troff macro set). Try
    /usr/share/doc/xterm/ctlseqs.ps.gz or
    /usr/share/doc/xterm/ctlseqs.txt.gz.

    Cheers,

    --
    Colin Watson [cjwatsonflatline.org.uk]


    --
    To UNSUBSCRIBE, email to [email]debian-user-requestlists.debian.org[/email]
    with a subject of "unsubscribe". Trouble? Contact [email]listmasterlists.debian.org[/email]
    Colin Watson Guest

  3. #3

    Default Re: xterm colour codes

    Colin Watson wrote:
    >On Wed, Jul 23, 2003 at 09:44:57AM +0100, David selby wrote:
    >
    >
    >>I cant find the control sequences doent ctlseqs.ms, though I have
    >>searched the system as root for it.
    >>
    >>
    >
    >.ms is the source form (it's a troff macro set). Try
    >/usr/share/doc/xterm/ctlseqs.ps.gz or
    >/usr/share/doc/xterm/ctlseqs.txt.gz.
    >
    >Cheers,
    >
    >
    >
    Many thanks, found the files ... don't understand this troff stuff yet
    ... more to learn !

    Dave


    --
    To UNSUBSCRIBE, email to [email]debian-user-requestlists.debian.org[/email]
    with a subject of "unsubscribe". Trouble? Contact [email]listmasterlists.debian.org[/email]
    David selby Guest

  4. #4

    Default Re: xterm colour codes

    On Wed, Jul 23, 2003 at 11:19:27AM +0100, David selby wrote:
    > Colin Watson wrote:
    > >On Wed, Jul 23, 2003 at 09:44:57AM +0100, David selby wrote:
    > >>I cant find the control sequences doent ctlseqs.ms, though I have
    > >>searched the system as root for it.
    > >
    > >.ms is the source form (it's a troff macro set). Try
    > >/usr/share/doc/xterm/ctlseqs.ps.gz or
    > >/usr/share/doc/xterm/ctlseqs.txt.gz.
    >
    > Many thanks, found the files ... don't understand this troff stuff yet
    That's OK, you don't need to in this case. :)

    --
    Colin Watson [cjwatsonflatline.org.uk]


    --
    To UNSUBSCRIBE, email to [email]debian-user-requestlists.debian.org[/email]
    with a subject of "unsubscribe". Trouble? Contact [email]listmasterlists.debian.org[/email]
    Colin Watson Guest

  5. #5

    Default Re: xterm colour codes

    [email]HdVDTO.TUDelft.NL[/email] wrote:
    >On Wed, 23 Jul 2003, David selby wrote:
    >
    >
    >
    >>I am trying to get my bash scripts to highlight some of their output in
    >>colour, a bit like ls --color
    >>It seems that I have to use ANSI esc sequences ...
    >>
    >>man xterm ..
    >>
    >>SEE ALSO
    >> resize(1), X(7), pty(4), tty(4)
    >> Xterm Control Sequences (this is the file ctlseqs.ms).
    >>
    >> [url]http://ey.his.com/xterm/xterm.html[/url]
    >>
    >>I cant find the control sequences doent ctlseqs.ms, though I have
    >>searched the system as root for it.
    >>
    >>
    >
    >I think I found it in /usr/share/doc/xterm not too long ago. Let me
    >check...
    >
    >$ ls /usr/share/doc/xterm
    >README.Debian ctlseqs.ps.gz xterm.faq.text.gz
    >xterm.terminfo.gz
    >changelog.Debian.gz ctlseqs.txt.gz xterm.log.html
    >copyright xterm.faq.html xterm.termcap.gz
    >
    >I did a lot of testing with ANSI sequences when writing TERM::ANSIMenu
    >and found that even though a lot of terminals say they are VT100
    >compliant (including the ANSI stuff), most of them do have some issues.
    >I am no KDE fan (I like it lean and mean, like windowmaker, but that's
    >another topic) but I must say that konsole did earn some credits in my
    >book during those tests. I seem to remember that xterm had trouble with
    >BLINK, if I am not mistaken it showed up as BOLD. If you want a full
    >list of all sequences that I did get working on most of them let me know
    >and I'll extract them from the perl code for you. Maybe the text below
    >is useful to you. I found it somewhere on the net:
    >
    >
    > ANSI Terminal Codes
    >
    >
    >
    > Here is the format of ANSI screen codes:
    >
    >
    >
    >
    > [ <Text Attribute> ; <Foreground Color> ; <Background Color> m
    >
    >
    >
    >
    > Text Attributes
    >
    >
    >
    > *0 - All attributes off
    > 1 - Bold
    > *
    > 5 - Blinking
    > *
    > *7 - Reverse
    >
    > *8 - Hidden
    >
    >
    > Foreground colors
    >
    >
    > 30 - Black
    > *
    > *31 - Red
    >
    > *32 - Green
    >
    > *33 - Yellow
    >
    > *34 - Blue
    >
    > *35 - Magenta
    >
    > *36 - Cyan
    >
    > *37 - White
    >
    >
    > Background colors
    >
    >
    > *40 Black
    >
    > *44 Blue
    >
    > *41 Red
    >
    > *45 Magenta
    >
    > *42 Green
    >
    > *46 Cyan
    > 43 Yellow
    > *
    > 47 White
    > *
    >
    > Before the [A;B;Cm you need an escape prefix. You can type it in each time
    > you need it. I only know how to make the escape prefix using vi. It is 4
    >
    > characters. They are ^v ^_ ^v ^[ (the ^ means the control key). On joe the
    > escape sequence is ^_^[. To save typing you can put this prefix in a file
    > and paste it when needed. Using Pico this is done using "^r". Here's an
    > example of a flashing white "hello" on a red background:
    >
    > ^v^_^v^[[5;37;41mhello^v^_^v^[[0m. On the right side of the sequence the
    > "[0m" resets the colors so the rest of the screen doesn't blink white on
    > red. All ansi sequences ( like [1;37;41m or [0m ) need to be preceded by
    > the escape prefix. When posting an article and you are prompted for a
    >
    > subject you can type just anything. When you are then in edit mode you go
    > to the subject line and erase whatever you just typed in and replace it
    > with your ansi text. The escape prefix must be typed in using vi. You can
    > create it using vi and put in a file and then paste it using whatever
    > editor you want.
    >
    >
    >
    >HTH
    >
    >
    >
    Spot on what I need !, thats great thanks. The esc sequence is a bit
    cryptic but I got the hang of it,
    Thanks again
    Dave


    --
    To UNSUBSCRIBE, email to [email]debian-user-requestlists.debian.org[/email]
    with a subject of "unsubscribe". Trouble? Contact [email]listmasterlists.debian.org[/email]
    David selby Guest

Similar Threads

  1. xterm function keys
    By Andrew McCallum in forum Linux / Unix Administration
    Replies: 2
    Last Post: August 17th, 01:00 AM
  2. Colour lost when creating a PDF from a FrameMaker doc that has an imported (colour) PDF inside it
    By adrian_morse@adobeforums.com in forum Adobe Acrobat Windows
    Replies: 5
    Last Post: April 28th, 11:35 AM
  3. xterm configuration
    By Marc Wilson in forum Debian
    Replies: 1
    Last Post: July 8th, 08:00 AM
  4. Changing xterm title.
    By Ken Steen in forum UNIX Programming
    Replies: 1
    Last Post: July 3rd, 08:11 AM
  5. problem with vi more and man in an xterm window
    By Paul Eggert in forum Sun Solaris
    Replies: 0
    Last Post: July 2nd, 11:30 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139