zsh-workers
 help / color / mirror / code / Atom feed
* zsh and xterm
@ 1996-11-08 11:08 Pierpaolo Righini
  1996-11-08 11:42 ` Geoff Wing
  1996-11-08 13:18 ` Zefram
  0 siblings, 2 replies; 6+ messages in thread
From: Pierpaolo Righini @ 1996-11-08 11:08 UTC (permalink / raw)
  To: zsh-workers

Hello,

please, i'd like to know in which way can I alter the appearance of an
xterm by putting the current directory and hostname in the title.
I've tried in the ksh-way, putting in the .zshrc:

PS1="$(print "\033")]2;[ $_U ]%m: %/$(print "\007 \r")$PSB "

and in fact this works for the title but then i have problems with the
muliline editing (it supposes to have written the title also after the
prompt and so the line is broken too early).
Are there other ways to do this? Are there someone who could mail me an
answer?

Pierpaolo Righini





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

* Re: zsh and xterm
  1996-11-08 11:08 zsh and xterm Pierpaolo Righini
@ 1996-11-08 11:42 ` Geoff Wing
  1996-11-08 13:18 ` Zefram
  1 sibling, 0 replies; 6+ messages in thread
From: Geoff Wing @ 1996-11-08 11:42 UTC (permalink / raw)
  To: Pierpaolo Righini; +Cc: zsh-workers

Pierpaolo Righini wrote:
:Hello,
:please, i'd like to know in which way can I alter the appearance of an
:xterm by putting the current directory and hostname in the title.
:I've tried in the ksh-way, putting in the .zshrc:
:
:PS1="$(print "\033")]2;[ $_U ]%m: %/$(print "\007 \r")$PSB "
:
:and in fact this works for the title but then i have problems with the
:muliline editing (it supposes to have written the title also after the
:prompt and so the line is broken too early).
:Are there other ways to do this? Are there someone who could mail me an
:answer?

You obviously don't have RPROMPT set;  it would immediately look worse if
you did.  Zsh has no way of knowing which characters get soaked up by the
terminal so you shouldn't put this type of stuff in the prompt. 
I have in my .zshrc something like

if [[ -n $DISPLAY ]]; then
    print -Pn  whatever
    chpwd() { print -Pn  whatever }
fi

where whatever are Prompt style strings (like your PS1 var).
-- 
Geoff Wing [gwing@primenet.com.au]   Technical Manager
  Phone    : +61-3-9818 2977	     PrimeNet - Internet Consultancy
  Facsimile: +61-3-9819 3788	     Web : <URL:http://www.primenet.com.au/>
  Mobile   : 0412 162 441


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

* Re: zsh and xterm
  1996-11-08 11:08 zsh and xterm Pierpaolo Righini
  1996-11-08 11:42 ` Geoff Wing
@ 1996-11-08 13:18 ` Zefram
  1996-11-08 20:39   ` zsh not sourcing .zsh* John Harres
  1 sibling, 1 reply; 6+ messages in thread
From: Zefram @ 1996-11-08 13:18 UTC (permalink / raw)
  To: Pierpaolo Righini; +Cc: zsh-workers

>PS1="$(print "\033")]2;[ $_U ]%m: %/$(print "\007 \r")$PSB "
>
>and in fact this works for the title but then i have problems with the
>muliline editing (it supposes to have written the title also after the
>prompt and so the line is broken too early).

Yes, you need to indicate to zsh that part of the prompt doesn't take
up any space on the screen:

PS1="%{$(print "\033")]2;[ $_U ]%m: %/$(print "\007 \r")%}$PSB "
     ^^                                                 ^^

But in this case it would be better to use the chpwd feature:

function chpwd {
  print -nP "\033]2;[ $_U ]%m: %/\007"
}

chpwd gets executed every time the current directory changes.  Other
things of this nature can be done using precmd, which is executed
before the prompt is displayed.

-zefram


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

* zsh not sourcing .zsh*
  1996-11-08 13:18 ` Zefram
@ 1996-11-08 20:39   ` John Harres
  1996-11-09 15:41     ` Zefram
  0 siblings, 1 reply; 6+ messages in thread
From: John Harres @ 1996-11-08 20:39 UTC (permalink / raw)
  To: zsh-workers

I just set up a new Sun running Solaris 2.5.1.  After installing zsh 3.0.1 on
it and copying my old .zsh* files over, I noticed that in some cases it is
not sourcing the .zsh* files.  When I log in, it works fine.  When I su to
root, I normally follow this with a 'zsh -'.  On this system, I noticed that
my prompt didn't change to reflect root's PROMPT variable, unlike the other
systems I have it installed on.  I also tried 'zsh -l', 'zsh -l -i', and 
'zsh -i' to no avail (in all cases the quotes are mine for clarity, not
actually part of the command).  After I do a '. /.zshrc', everything is fine
(except for the rest of the .zsh* files).

Ideas?

John


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

* Re: zsh not sourcing .zsh*
  1996-11-08 20:39   ` zsh not sourcing .zsh* John Harres
@ 1996-11-09 15:41     ` Zefram
  1996-11-10  1:51       ` John Harres
  0 siblings, 1 reply; 6+ messages in thread
From: Zefram @ 1996-11-09 15:41 UTC (permalink / raw)
  To: John Harres; +Cc: zsh-workers

Have you checked whether $HOME is being set correctly?

-zefram


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

* Re: zsh not sourcing .zsh*
  1996-11-09 15:41     ` Zefram
@ 1996-11-10  1:51       ` John Harres
  0 siblings, 0 replies; 6+ messages in thread
From: John Harres @ 1996-11-10  1:51 UTC (permalink / raw)
  To: Zefram; +Cc: zsh-workers

No, I hadn't.  But you are right, it's not being changed when I su.  After
a quick look at the man page for su, I guess I'll be doing a 'su -' from now
on.

Thanks!
John


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

end of thread, other threads:[~1996-11-10  3:47 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-11-08 11:08 zsh and xterm Pierpaolo Righini
1996-11-08 11:42 ` Geoff Wing
1996-11-08 13:18 ` Zefram
1996-11-08 20:39   ` zsh not sourcing .zsh* John Harres
1996-11-09 15:41     ` Zefram
1996-11-10  1:51       ` John Harres

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).