zsh-users
 help / color / mirror / code / Atom feed
From: Shawn Leas <sleas@ixion.honeywell.com>
To: Z Shell Users <zsh-users@math.gatech.edu>
Subject: Xterm title changing prompt problem: HELP!
Date: Thu, 14 Jan 1999 16:17:05 -0600 (CST)	[thread overview]
Message-ID: <Pine.GHP.4.05.9901141611470.26309-100000@ixion.honeywell.com> (raw)

[-- 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.
<============================================> 


             reply	other threads:[~1999-01-14 22:25 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-01-14 22:17 Shawn Leas [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.GHP.4.05.9901141611470.26309-100000@ixion.honeywell.com \
    --to=sleas@ixion.honeywell.com \
    --cc=zsh-users@math.gatech.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).