LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
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


Reply
  Search this Thread
Old 07-17-2003, 11:26 AM   #1
GrayGh0st
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?

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

Rep: Reputation: 48
http://man.linuxquestions.org/index....ction=0&type=2
(hint:why are you coming here without trying the manpages ,google etc)
man pages are available here
http://man.linuxquestions.org
google for linux
http://google.com/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
GrayGh0st
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
rch
Member
 
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
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.
 
  


Reply


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

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 01:12 AM.

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