zsh-workers
 help / color / mirror / code / Atom feed
From: wjf103@york.ac.uk (Wez Furlong)
To: Richard Coleman <coleman@math.gatech.edu>, zsh-workers@math.gatech.edu
Subject: Re: forwarded message
Date: Sat, 21 Jun 1997 02:48:08 +0100	[thread overview]
Message-ID: <199706210148.CAA03999@sgi19.york.ac.uk> (raw)
In-Reply-To: Richard Coleman <coleman@math.gatech.edu>       "forwarded message" (Jun 20,  2:32pm)

On Jun 20,  2:32pm, Richard Coleman wrote:

: In brief, it seems that %{...%} is not working properly inside PS1.
: 
: In tcsh, I use
: 
: set prompt="%{\033]2;%n@%M:%/ - %l\007\033]1;%l@%m\007%}%h [%T] %B%n%b@%m:%B%.2%#%b "

As far as I understand the docs, the string between the %{...%} should
not move the cursor in any way - I'm not sure if your sequence moves the
cursor or not (I haven't really looked: this is a quickie mail), but
this is worth checking in detail.

I don't set my titlebar in this way; I use this method:

One of the features of zsh is the precmd function which gets run before
the prompt is printed.

In my precmd function I call another function called title:

function precmd () { 
	title Zsh
};

function title () 
{
	case $TERM in
		iris-ansi*)	print -n -P "\2201.y$* ~ $USER@%m:%~\234\2203.y~ %m:%~\234\2203.y$USER@%m\234" ;;
		xterm*)	print -Pn "\e]2;$* ~ $USER@%m:%~\a\e]1;$USER@%m\a" ;;
	esac	
}

this sets my title for me on both xwsh and xterm.

My prompt variable looks like this:

CSI='^[['
prompt="%{${CSI}0m%} %(18328#::%{${CSI}32m%}%n )%{${CSI}35m%}%m %{${CSI}31m%}tty%l %{${CSI}33m%}~ %{${CSI}36m%}%h %{${CSI}35m%}%03. %(?::%{${CSI}32m%}%? )%{${CSI}0m%}> %(#.#.)"

Where 18328 is my numeric userid. 

Note that the ^[ is actually a quoted ESC put in by vi : I can't
remember if I managed to get it working with \033, but I'd guess not
judging by that ESC :)

Sorry I haven't explained much, but I've gotta go - no doubt some of the
other readers of the list will go into more detail...




-- 
Wez - Electronics Undergraduate at the University of York
URL : http://www.twinklestar.demon.co.uk/

Insult Of The Day: Thou mammering tardy-gaited death-token!


             reply	other threads:[~1997-06-21  1:54 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-06-21  1:48 Wez Furlong [this message]
  -- strict thread matches above, loose matches on Subject: below --
1997-06-20 18:32 Richard Coleman
1997-06-21 15:15 ` Zefram
1997-06-21 15:20   ` Hrvoje Niksic
1997-06-21 15:25     ` Zefram
1997-06-21 15:35       ` Hrvoje Niksic
1997-06-21 15:45         ` Zefram

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=199706210148.CAA03999@sgi19.york.ac.uk \
    --to=wjf103@york.ac.uk \
    --cc=coleman@math.gatech.edu \
    --cc=zsh-workers@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).