*BSD News Article 14083


Return to BSD News archive

Xref: sserve comp.unix.amiga:4276 comp.unix.questions:32902 comp.unix.bsd:11759 comp.unix.misc:6935 comp.sys.amiga.datacomm:11682 comp.sys.amiga.misc:28683
Newsgroups: comp.unix.amiga,comp.unix.questions,comp.unix.bsd,comp.unix.misc,comp.sys.amiga.datacomm,comp.sys.amiga.misc
Path: sserve!newshost.anu.edu.au!munnari.oz.au!news.Hawaii.Edu!ames!sun-barr!cs.utexas.edu!uunet!pipex!sunic!ericom!eos.ericsson.se!etxmesa
From: etxmesa@eos.ericsson.se (Michael Salmon)
Subject: Re: Esc sequences in prompts (why doesn't it work)
Message-ID: <1993Apr6.082459.6558@ericsson.se>
Sender: etxmesa@eos6c02 (Michael Salmon)
Nntp-Posting-Host: eos6c02.ericsson.se
Reply-To: etxmesa@eos.ericsson.se (Michael Salmon)
Organization: Ericsson Telecom AB
References: <1993Apr5.005712.15667@cs.aukuni.ac.nz> <SIGNALS.93Apr5112617@krypton.Mankato.MSUS.EDU> <1993Apr5.170600.24477@mnemosyne.cs.du.edu>
Distribution:  world
Date: Tue, 6 Apr 1993 08:24:59 GMT
Lines: 47

In article <1993Apr5.170600.24477@mnemosyne.cs.du.edu>
rduta@nyx.cs.du.edu (Fb<A!R>x/G{p!Z}) writes:
|> I'm trying to create a tcsh prompt that uses regular vt100 escape sequences.,
|> the only problem is that it doesn't work.  It seem that all the escape
|> characters are just displayd with the ^[***.  Is there any way to fix this
|> problem.  

From the man page for tcsh:

12. NEW PROMPT FORMAT
     The format for the prompt shell variable has been changed to
     include  many  new  things, such as the current time of day,
     current  working  directory,  etc..   The  new  format  uses
     "%<char>"  to signal an expansion, much like printf(3S). The
     available sequences are:
[...]
           %U (%u)     Start (stop) underline mode. (Only if
                       tcsh was compiled to be eight bit clean.)
[...]
           \c          `c' is parsed the same way as in bindkey.
           ^c          `c' is parsed the same way as in bindkey.

and

     In strings control  characters  may  be  written  as  caret-
     <letter>  and  backslash ("\") is used to escape a character
     as follows:
          \a   bell character
          \n   line feed (new line)
          \b   back space
          \t   horizontal tab
          \v   vertical tab
          \f   form feed
          \r   carriage return
          \e   escape
          \nnn character code in octal

-- 

Michael Salmon

#include	<standard.disclaimer>
#include	<witty.saying>
#include	<fancy.pseudo.graphics>

Ericsson Telecom AB
Stockholm