www.delorie.com/gnu/docs/screen/screen_51.html   search  
 
Buy GNU books!


Screen User's Manual

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

10.1.3 Setting up your prompt for shell titles

One thing to keep in mind when adding a null title-escape-sequence to your prompt is that some shells (like the csh) count all the non-control characters as part of the prompt's length. If these invisible characters aren't a multiple of 8 then backspacing over a tab will result in an incorrect display. One way to get around this is to use a prompt like this:

 
set prompt='k\% '

The escape-sequence `' not only normalizes the character attributes, but all the zeros round the length of the invisible characters up to 8.

Tcsh handles escape codes in the prompt more intelligently, so you can specify your prompt like this:

 
set prompt="%{\ek\e\\%}\% "

Bash users will probably want to echo the escape sequence in the PROMPT_COMMAND:

 
PROMPT_COMMAND='echo -n -e "\033k\033\134"'

(I used `\134' to output a `\' because of a bug in v1.04).


  webmaster   donations   bookstore     delorie software   privacy  
  Copyright © 2003   by The Free Software Foundation     Updated Jun 2003  

Please take a moment to fill out this visitor survey
You can help support this site by visiting the advertisers that sponsor it! (only once each, though)