Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 07-17-2003, 11:26 AM   #1
LQ Newbie
Registered: Jun 2003
Location: USA
Distribution: RedHat 9.0
Posts: 16

Rep: Reputation: 0
Question Xterm escape sequences

I was wondering if there was a list online anywhere of all Xterm escape sequences. By that I mean, a reference that would help me decipher something like the following for a tcsh shell:

set prompt="%{\e]2\;%m:%/^g\e]1\;%m^g\r%}%m %S[%h]%s [%n] %B%c%b: "

Now, I understand part of this. I know that stuff like %m, %S, and %h are tcsh specific (machine name, reverse video, and hostname respectively). What I'm having trouble with is mainly the stuff between the %{...%}'s. Specifically, \e], ^g, \r. I also know that what's between %{...%} is stuff that modifes xterm's title bar. So my question is, is there a page that describes the inner workings of this?? The tcsh man page doesn't do a great job. Are the escape sequences that I can't identify linux, xterm, or tcsh specific? Or all of the above?

Old 07-18-2003, 02:33 AM   #2
Registered: Feb 2003
Location: Santa Clara,CA
Distribution: Mandriva
Posts: 909

Rep: Reputation: 48
(hint:why are you coming here without trying the manpages ,google etc)
man pages are available here
google for linux
search for man page in your computer for command x
man x
0 members found this post helpful.
Old 07-18-2003, 10:25 AM   #3
LQ Newbie
Registered: Jun 2003
Location: USA
Distribution: RedHat 9.0
Posts: 16

Original Poster
Rep: Reputation: 0
I HAVE done all that. That's how I found the information that I have. I wouldn't come here if I could find all the info. I need. - Justin
Old 07-19-2003, 01:10 AM   #4
Registered: Feb 2003
Location: Santa Clara,CA
Distribution: Mandriva
Posts: 909

Rep: Reputation: 48
so did you get the information from the first link
i would like to quote here from the manpage
prompt The string which is printed before reading each
command from the terminal. prompt may include any
of the following formatting sequences (+), which
are replaced by the given information:
%/ The current working directory.
%~ Thecurrent working directory, but with one's
home directory represented by `~' and other
users' home directories represented by `~user'
as per Filename substitution. `~user' substi
tution happens only if the shell has already
used `~user' in a pathname in the current ses
%c[[0]n], %.[[0]n]
Thetrailing component of the current working
directory, or n trailing components if a digit
n is given. If n begins with `0', the number
of skipped components precede the trailing
component(s) in the format `/<skipped>trail
ing'. If the ellipsis shell variable is set,
skipped components are represented by an
ellipsis so the whole becomes `...trailing'.
`~' substitution is done as in `%~' above, but
the `~' component is ignored when counting
trailing components.
%C Like %c, but without `~' substitution.
%h, %!, !
The current history event number.
%M The full hostname.
%m The hostname up to the first `.'.
%S (%s)
Start (stop) standout mode.
%B (%b)
Start (stop) boldfacing mode.
%U (%u)
Start (stop) underline mode.
%t, %@
The time of day in 12-hour AM/PM format.
%T Like `%t', but in 24-hour format (but see the
ampm shell variable).
%p The `precise' time of day in 12-hour AM/PM
format, with seconds.
%P Like `%p', but in 24-hour format (but see the
ampm shell variable).
\c c is parsed as in bindkey.
^c c is parsed as in bindkey.
%% A single `%'.
%n The user name.
%d The weekday in `Day' format.
%D The day in `dd' format.
%w The month in `Mon' format.
%W The month in `mm' format.
%y The year in `yy' format.
%Y The year in `yyyy' format.
%l The shell's tty.
%L Clears from the end of the prompt to end of
the display or the end of the line.
%$ Expands the shell or environment variable name
immediately after the `$'.
%# `>' (or the first character of the promptchars
shell variable) for normal users, `#' (or the
second character of promptchars) for the supe
Includes string as a literal escape sequence.
It should be used only to change terminal
attributes and should not move the cursor
location. This cannot be the last sequence in
%? Thereturncode of the command executed just
before the prompt.
%R In prompt2, the status ofthe parser. In
prompt3, the corrected string. In history,
the history string.
`%B', `%S', `%U' and `%{string%}' are available in
only eight-bit-clean shells; see the version shell
The bold, standout andunderline sequences are
often used to distinguish a superuser shell. For
> set prompt = "%m[%h] %B[%@]%b[%/] you
rang? "
tut [37] [2:54pm] [/usr/accts/sys] you rang? _
If `%t', `%@', `%T', `%p', or `%P' is used, and
noding is notset, then print `DING!' on the
change of hour (i.e, `:00' minutes) instead of the
actual time.
Set by default to `%# ' in interactive shells.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
RPM Install Experiences -- Sequences Lsatenstein Fedora - Installation 2 08-08-2005 09:53 AM
echo out CTRL- sequences how to? jamesps Linux - General 0 07-22-2005 05:16 PM
Analyzing Protein Sequences Lostlucidty Linux - Software 7 05-24-2005 11:14 AM
listing sequences of files to the shell jimmyj90 Linux - Newbie 4 10-20-2004 06:18 PM
How to stop terminal escape sequences ? Mike Davies Linux - Newbie 1 08-08-2004 12:37 PM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:19 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration