Return to BSD News archive
Xref: sserve comp.unix.amiga:4287 comp.unix.questions:33011 comp.unix.bsd:11786 comp.unix.misc:6973 comp.sys.amiga.datacomm:11729 comp.sys.amiga.misc:28797
Path: sserve!newshost.anu.edu.au!munnari.oz.au!news.Hawaii.Edu!ames!agate!howland.reston.ans.net!noc.near.net!bigboote.WPI.EDU!nntp!rion
From: rion@bear.WPI.EDU (rion hall)
Newsgroups: comp.unix.amiga,comp.unix.questions,comp.unix.bsd,comp.unix.misc,comp.sys.amiga.datacomm,comp.sys.amiga.misc
Subject: Re: Esc sequences in prompts (why doesn't it work)
Date: 8 Apr 93 21:53:30
Organization: style inc. (livin' on principle alone)
Lines: 70
Message-ID: <RION.93Apr8215330@bear.WPI.EDU>
References: <SIGNALS.93Apr5112617@krypton.Mankato.MSUS.EDU>
<1993Apr5.170600.24477@mnemosyne.cs.du.edu>
<GOWEN.93Apr5161117@jade.tufts.edu>
<1993Apr6.181230.16283@rtsg.mot.com>
NNTP-Posting-Host: bear.wpi.edu
In-reply-to: king@rtsg.mot.com's message of Tue, 6 Apr 1993 18:12:30 GMT
okay y'all, this is from the man pages of tcsh... at least on
this system... so if it helps... it helps. this is how I put in escape
code flash ^[[5m into my prompt. There is a special flag in tcsh to
put in escape codes, and the followin' is an except of the set prompt
feature from the man pages.
%/ Current working directory.
%~ cwd. If it starts with $HOME, that part is
replaced by a ~. In addition if a directory
name prefix matches a user's home directory,
that part of the directory will be substituted
with ~user. NOTE: The ~user substitution will
only happen if the shell has performed a ~
expansion for that user name in this session.
%c or %. Trailing component of cwd, may be
followed by by a digit to get more than one
component, if it starts with $HOME, that
part is replaced with a ~.
%C Trailing component of cwd, may be followed
by a digit to get more than one component, no
~ substitution.
%h, %!, ! Current history event number.
%M The full machine hostname.
%m The hostname up to the first ".".
%S (%s) Start (stop) standout mode.
%B (%b) Start (stop) boldfacing mode. (Only if
tcsh was compiled to be eight bit clean.)
%U (%u) Start (stop) underline mode. (Only if
tcsh was compiled to be eight bit clean.)
%t or %@ Current time of day, in 12-hour, am/pm format.
%T Current time of day, in 24-hour format.
(But see the ampm shell variable below.)
\c `c' is parsed the same way as in bindkey.
^c `c' is parsed the same way as in bindkey.
%% A single %.
%n The user name, contents of $user.
%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 line (tty) the user is logged on.
%L clear from prompt to end of display or end of line.
%# A `#' if tcsh is run as a root shell,
a `>' if not.
%? return code of the last command executed just
before the prompt.
%R In prompt3 this is the corrected string; in
prompt2 it is the status of the parser.
--------> %{..%} Include string as a literal escape sequence.
Note that the enclosed escape sequence, should
only be used to change terminal attributes and
should not move the cursor location. Also, this
cannot be the last character in the prompt
string. (Available only if tcsh was compiled to
be eight bit clean.)
please note, this only works if it was compiled with this
option. if it does work, it's a hell of a lot easier than catin' a
file every time you want a prompt.
-rion hall-
<-- <-- <-- <-- <-- <-- <-- <-- <-- <-- <-- <-- <-- <-- *rion@wpi.wpi.edu* --->
The desire of the moth for the star, The devotion to something afar
Of the night for the morrow, From the sphere of our sorrow.
-- Shelley