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. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
07-17-2003, 11:26 AM
|
#1
|
LQ Newbie
Registered: Jun 2003
Location: USA
Distribution: RedHat 9.0
Posts: 16
Rep:
|
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?
Thanks!
Justin
|
|
|
07-18-2003, 10:25 AM
|
#3
|
LQ Newbie
Registered: Jun 2003
Location: USA
Distribution: RedHat 9.0
Posts: 16
Original Poster
Rep:
|
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
|
|
|
07-19-2003, 01:10 AM
|
#4
|
Member
Registered: Feb 2003
Location: Santa Clara,CA
Distribution: Mandriva
Posts: 909
Rep:
|
so did you get the information from the first link
i would like to quote here from the manpage
Quote:
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
sion.
%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
ruser.
%{string%}
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
prompt.
%? 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
variable.
The bold, standout andunderline sequences are
often used to distinguish a superuser shell. For
example,
> 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.
|
|
|
|
All times are GMT -5. The time now is 01:12 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|