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

Xterm title changing prompt problem: HELP!



This new thing I found is too kewl, but I need a little help.

It sets the Xterm title by echoing:
<ESC>]; put string here^G and then the rest of the prompt.

However, my right prompt is shifted to the left.  I suspect
This is due to zsh keeping track of the length of the left
part of the prompt, then adjusting where to put the right one.

Should I just not have a right prompt? Or is there a way around
this?

PROMPT='];[%l] %n@%m %1v (%h) %t[%l] %n@%m %1v (%h) %t '
RPROMPT=' %~'
function precmd {
  setopt no_ksh_arrays local_options
  case "${${$(uptime)##*"load average: "}%%,*}" in
    0.[0-4]*) psvar[1]='%^)' ;;
    0.[5-9]*) psvar[1]=';^]' ;;
    1.*)      psvar[1]=';^|' ;;
    2.*)      psvar[1]=':^|' ;;
    3.*)      psvar[1]=':^(' ;;
    [45].*)   psvar[1]=':^O' ;;
    [67].*)   psvar[1]='|-P' ;;
    *)        psvar[1]='|-(' ;;
  esac
}

-Shawn
<=========== America Held Hostage ===========>
   Day 2185 for the poor and the middle class. 
   Day 2204 for the rich and the dead.
   737 days remaining in the Raw Deal.
<============================================> 



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