Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: zsh and xterm

Pierpaolo Righini wrote:
:please, i'd like to know in which way can I alter the appearance of an
:xterm by putting the current directory and hostname in the title.
:I've tried in the ksh-way, putting in the .zshrc:
:PS1="$(print "\033")]2;[ $_U ]%m: %/$(print "\007 \r")$PSB "
:and in fact this works for the title but then i have problems with the
:muliline editing (it supposes to have written the title also after the
:prompt and so the line is broken too early).
:Are there other ways to do this? Are there someone who could mail me an

You obviously don't have RPROMPT set;  it would immediately look worse if
you did.  Zsh has no way of knowing which characters get soaked up by the
terminal so you shouldn't put this type of stuff in the prompt. 
I have in my .zshrc something like

if [[ -n $DISPLAY ]]; then
    print -Pn  whatever
    chpwd() { print -Pn  whatever }

where whatever are Prompt style strings (like your PS1 var).
Geoff Wing [gwing@xxxxxxxxxxxxxxx]   Technical Manager
  Phone    : +61-3-9818 2977	     PrimeNet - Internet Consultancy
  Facsimile: +61-3-9819 3788	     Web : <URL:http://www.primenet.com.au/>
  Mobile   : 0412 162 441

Messages sorted by: Reverse Date, Date, Thread, Author