From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from euclid.skiles.gatech.edu (list@euclid.skiles.gatech.edu [130.207.146.50]) by melb.werple.net.au (8.7.5/8.7.3/2) with ESMTP id JAA23981 for ; Fri, 12 Jul 1996 09:27:45 +1000 (EST) Received: (from list@localhost) by euclid.skiles.gatech.edu (8.7.3/8.7.3) id TAA02219; Thu, 11 Jul 1996 19:01:36 -0400 (EDT) Resent-Date: Thu, 11 Jul 1996 18:59:54 -0400 (EDT) From: "Bart Schaefer" Message-Id: <960711160041.ZM10008@candle.brasslantern.com> Date: Thu, 11 Jul 1996 16:00:33 -0700 In-Reply-To: DeWitt Clinton "On the topic of prompts" (Jul 11, 1:51pm) References: Reply-To: schaefer@nbn.com X-Mailer: Z-Mail (4.0b.702 02jul96) To: DeWitt Clinton , zsh-users@math.gatech.edu Subject: Re: On the topic of prompts MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Resent-Message-ID: <"2m8UA3.0.hX.fTOvn"@euclid> Resent-From: zsh-users@math.gatech.edu X-Mailing-List: archive/latest/287 X-Loop: zsh-users@math.gatech.edu X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu On Jul 11, 1:51pm, DeWitt Clinton wrote: > Subject: On the topic of prompts > > Since there is probably no way to justify a section of the prompt, perh= aps > there is a way to tell rprompt to write to the line just above using > control characters? Just wondering... Sure. Note that the following won't work properly if you don't have a newline in PS1. RPS1=3D"%{$(echotc ku)%}whatever you want here%{$(echotc kd)%}" You might have to replace $(echotc ku) and $(echotc kd) with different up and down escapes for your terminal if your terminal has a keypad transmit mode, because keypad mode is normally not in use. I tried $(echotc up) and $(echotc do) but that doesn't work because "do" is frequently just ctrl-J, which zsh strips out of rprompts. > Also, is there a way to pad the variables with spaces? If so, that wou= ld = > solve this problem entirely. Sort of. precmd() { fakePS1=3D$(print -nP " %h %m %n %~ %W") unset fakeRPS1 # Clear any previous `typeset -R` fakeRPS1=3D$(print -nP %@) if [[ $[$COLUMNS-$#fakePS1-$#fakeRPS1-2] -gt 0 ]] then typeset -R $[$COLUMNS-$#fakePS1-1] fakeRPS1=3D"$fakeRPS1" PS1=3D"$fakePS1$fakeRPS1 % " else PS1=3D"$fakePS1 % " fi } > While I am thinking about it, what I am really looking for is a status = bar > that would just sit at the top of the screen and hold certain useful > information. Anyone know of how to achieve this? You can play all sorts of games with %{...%} and termcap sequences if your terminal can set scrolling regions and so forth. If you're using an xterm, you can use something like this to change the title bar: if [[ "$TERM" =3D xterm* || "$TERM" =3D vs100 || "$TERM" =3D vs100s ]] then # Set top to introduce titlebar change top=3D'=1B]0;' # Set back to end titlebar change back=3D'=07' # Create precmd() to put stuff in the title bar precmd() { print -nP "%{$top%m.%l:%2c - %t$back%}" } fi -- = Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.nbn.com/people/lante= rn New male in /home/schaefer: >N 2 Justin William Schaefer Sat May 11 03:43 53/4040 "Happy Birthday= "