zsh-users
 help / color / mirror / code / Atom feed
* Xterm title changing prompt problem: HELP!
@ 1999-01-14 22:17 Shawn Leas
  1999-01-14 23:25 ` Geoff Wing
  0 siblings, 1 reply; 8+ messages in thread
From: Shawn Leas @ 1999-01-14 22:17 UTC (permalink / raw)
  To: Z Shell Users

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: TEXT/PLAIN; charset=X-UNKNOWN, Size: 1087 bytes --]

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\a[%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.
<============================================> 


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~1999-01-18 10:55 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-01-14 22:17 Xterm title changing prompt problem: HELP! Shawn Leas
1999-01-14 23:25 ` Geoff Wing
1999-01-15 11:48   ` Andrew Gallagher
1999-01-15 11:58     ` Bruce Stephens
1999-01-15 14:29     ` Geoff Wing
1999-01-15 15:41       ` Andrew Gallagher
1999-01-15 17:05         ` Geoff Wing
1999-01-18 10:45           ` Andrew Gallagher

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).