zsh-users
 help / color / mirror / code / Atom feed
* Titlebar-handling with zsh and screen
@ 2002-03-09  3:12 Juhapekka Tolvanen
  2002-03-09  5:12 ` Vincent Lefevre
  2002-03-09  7:23 ` John Beppu
  0 siblings, 2 replies; 6+ messages in thread
From: Juhapekka Tolvanen @ 2002-03-09  3:12 UTC (permalink / raw)
  To: zsh-users, Sven Guckes, jw, ric


Maybe this is already mentioned in soon-to-be-released new version of
"Xterm-Title mini-HOWTO":

http://cns.georgetown.edu/~ric/howto/Xterm-Title/

I just added handling of titlebar uner screen to my zsh-configs. I had
to add some stuff to my ~/.screenrc because of that, so from now on that
file is part of my shellrc-tarball. You can get it right here:

http://www.cc.jyu.fi/~juhtolv/configs/shellrc/

>From this doc:

http://www4.informatik.uni-erlangen.de/~jnweiger/screen-faq.html

I found this:

---- Clip ----
if ($TERM == screen) then
        set prompt="%{ESC_#$WINDOW %m:%c3ESC\\%}%h (%m:%.)%# "
else
        set prompt="%h (%m:%.)%# "
endif

(Note that ESC means a real ESC (octal 033) chars).
---- Clip ----

Unfortunately that setting is for certain distorted image of shell. That
shell is known as tcsh and it is really b0rken. Therefore I had to
create such settings for zsh myself.

So, please download my shellconfigs and check out files dot.zshrc and
dot.screenrc and try to find bugs or other errors. They seem to work for
me, but I am not very sure, why on earth they work.

P.S: I do not subscribe to zsh-mailinglists, so please Cc: to me your
replies. And I do not subscribe to mailinglists of screen, so please
forward this to that kind of lists.


-- 
Juhapekka "naula" Tolvanen * * * Univ. of Jyväskylä * * * juhtolv@st.jyu.fi
http://www.st.jyu.fi/~juhtolv/index.html * * * * "STRAIGHT BUT NOT NARROW!"
"ei, en elättele kuvitelmia. on arjen koura kova kohtaan keltanokkia."  CMX


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

* Re: Titlebar-handling with zsh and screen
  2002-03-09  3:12 Titlebar-handling with zsh and screen Juhapekka Tolvanen
@ 2002-03-09  5:12 ` Vincent Lefevre
  2002-03-09  5:18   ` Clint Adams
  2002-03-09  7:23 ` John Beppu
  1 sibling, 1 reply; 6+ messages in thread
From: Vincent Lefevre @ 2002-03-09  5:12 UTC (permalink / raw)
  To: Juhapekka Tolvanen; +Cc: zsh-users, Sven Guckes, jw, ric

On Sat, Mar 09, 2002 at 05:12:50 +0200, Juhapekka Tolvanen wrote:
> So, please download my shellconfigs and check out files dot.zshrc and
> dot.screenrc and try to find bugs or other errors. They seem to work for
> me, but I am not very sure, why on earth they work.

Not here: when I change the screen window, the titlebar isn't updated.
I posted an article about this in a French newsgroup (fr.comp.os.unix)
several months ago, but got no solution.

-- 
Vincent Lefèvre <vincent@vinc17.org> - Web: <http://www.vinc17.org/> - 100%
validated (X)HTML - Acorn Risc PC, Yellow Pig 17, Championnat International
des Jeux Mathématiques et Logiques, TETRHEX, etc.
Work: CR INRIA - computer arithmetic / SPACES project at LORIA


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

* Re: Titlebar-handling with zsh and screen
  2002-03-09  5:12 ` Vincent Lefevre
@ 2002-03-09  5:18   ` Clint Adams
  2002-03-09 23:55     ` Vincent Lefevre
  2002-03-10  1:38     ` Vincent Lefevre
  0 siblings, 2 replies; 6+ messages in thread
From: Clint Adams @ 2002-03-09  5:18 UTC (permalink / raw)
  To: Juhapekka Tolvanen, zsh-users, Sven Guckes, jw, ric

> Not here: when I change the screen window, the titlebar isn't updated.
> I posted an article about this in a French newsgroup (fr.comp.os.unix)
> several months ago, but got no solution.

Depending on the version of screen you have, putting this in your
.screenrc may help.

hardstatus string "%h (%n.%t)%? users: %u%?"
termcapinfo xterm*|rxvt* hs:ts=\E]2;:fs=^G:ds=\E]2;TITLEDISABLED^G


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

* Re: Titlebar-handling with zsh and screen
  2002-03-09  3:12 Titlebar-handling with zsh and screen Juhapekka Tolvanen
  2002-03-09  5:12 ` Vincent Lefevre
@ 2002-03-09  7:23 ` John Beppu
  1 sibling, 0 replies; 6+ messages in thread
From: John Beppu @ 2002-03-09  7:23 UTC (permalink / raw)
  To: Juhapekka Tolvanen; +Cc: zsh-users, Sven Guckes, jw, ric

[  date  ] 2002/03/09 | Saturday | 05:12 AM
[ author ] Juhapekka Tolvanen <juhtolv@st.jyu.fi> 

> So, please download my shellconfigs and check out files dot.zshrc and
> dot.screenrc and try to find bugs or other errors. They seem to work for
> me, but I am not very sure, why on earth they work.
 
To make it work with: 

    Terminal.app    (Mac OS X)
    Terminal.app    (NeXTstep)
    Stuart.app      (NeXTstep)

add the following to the case statement in your dot.zshrc 

- - - - 8< - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
vt100)
  if (( $+TERM_PROGRAM && $+TERM_PROGRAM_VERSION )) ||  # Terminal.app
     (( $+STUART ))                                     # Stuart.app
  then
      precmd()
      {
        writetitle
        print -Pn "\e]0;${TITLETEXT}\a"
      }

      preexec()
      {
        writeexectitle $1
        print -Pn '\e]0;'"${EXECTEXT1}"
        print -rn "${EXECTEXT2}"
        print -Pn '\a'
      }
  fi
;;
- - - - 8< - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



Mac OS X and NeXTstep users will also need to add the following line
to dot.screenrc.

    termcapinfo vt100 'hs:ts=\E]0;:fs007:ds=\E]0;'

This termcapinfo line is probably wrong for everyone else, though.



PS: The NeXTstep stuff is hypothetical, because I don't have
    screen installed on my NeXT slab, and it only has an
    old zsh from 1994.

        [[ $VERSION = 2.5.02 ]]   # to be exact

    It doesn't know about %y (for putting the tty info in the
    title bar) and the preexec() function means nothing to it.

    (I tried to compile zsh-4.0.4 a while ago, but it didn't get
    very far using gcc 2.5.8....  However, it was a pleasant
    surprise when vim-6 compiled and worked.)


-- 
package wuv'apqvjgt;($_=join('',(*PgtnHcemgt))) # print map "beppu\@$_\n", qw(
=~ s/([HaP])(?!e)/ \U>$1/g;s/^.|:| (?=A)|>//g;y # cpan.org  lbox.org  binq.org
/c-z/a-u/;print"J$_\n";#$^%$^X@.^ <!-- japh --> # oss.lineo.com codepoet.org);


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

* Re: Titlebar-handling with zsh and screen
  2002-03-09  5:18   ` Clint Adams
@ 2002-03-09 23:55     ` Vincent Lefevre
  2002-03-10  1:38     ` Vincent Lefevre
  1 sibling, 0 replies; 6+ messages in thread
From: Vincent Lefevre @ 2002-03-09 23:55 UTC (permalink / raw)
  To: zsh-users

On Sat, Mar 09, 2002 at 00:18:05 -0500, Clint Adams wrote:
> hardstatus string "%h (%n.%t)%? users: %u%?"
> termcapinfo xterm*|rxvt* hs:ts=\E]2;:fs=^G:ds=\E]2;TITLEDISABLED^G

Thanks, this is exactly what I was looking for.

-- 
Vincent Lefèvre <vincent@vinc17.org> - Web: <http://www.vinc17.org/> - 100%
validated (X)HTML - Acorn Risc PC, Yellow Pig 17, Championnat International
des Jeux Mathématiques et Logiques, TETRHEX, etc.
Work: CR INRIA - computer arithmetic / SPACES project at LORIA


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

* Re: Titlebar-handling with zsh and screen
  2002-03-09  5:18   ` Clint Adams
  2002-03-09 23:55     ` Vincent Lefevre
@ 2002-03-10  1:38     ` Vincent Lefevre
  1 sibling, 0 replies; 6+ messages in thread
From: Vincent Lefevre @ 2002-03-10  1:38 UTC (permalink / raw)
  To: Clint Adams; +Cc: Juhapekka Tolvanen, zsh-users, Sven Guckes, jw, ric

BTW, for those who are interested, here's my current code for the
terminal title:

In .screenrc:

hardstatus off
hardstatus string "%h%n (%t)"
termcapinfo xterm*|rxvt hs:ts=\E]2;:fs=^G:ds=\E]2;TITLEDISABLED^G

In .zshrc:

zmodload -i zsh/parameter

precmd()
{
  psvar[1]=$#jobstates;
  if [[ $psvar[1] -eq 0 ]] then
    psvar[1]=()
  elif [[ $psvar[1] -eq 1 ]] then
    psvar[1]="$psvar[1] job"
  else
    psvar[1]="$psvar[1] jobs"
  fi
  [[ -n $TTY && $TERM == (xterm*|dtterm|rxvt|screen*) ]] &&
    {
      print -nP "\e]1;%m:%.\x07"
      print -nP "\e]2;%(1v. %1v |.)${WINTITLE:+ $WINTITLE |} %n@%m - %~ | %y"
      [[ $TERM == screen* ]] && print -n .
      print -n "\x07"
    } > $TTY
}

TRAPCLD() { [[ -o interactive && -n $TTY ]] && precmd }

However, there's still a problem when a job terminates at the wrong
place. For instance:

$ sleep 5 &
$ screen

When the sleep terminates, the title will be (incorrectly) updated.
Moreover, I don't understand why the title doesn't come back to its
correct value when I hit the Return key.

-- 
Vincent Lefèvre <vincent@vinc17.org> - Web: <http://www.vinc17.org/> - 100%
validated (X)HTML - Acorn Risc PC, Yellow Pig 17, Championnat International
des Jeux Mathématiques et Logiques, TETRHEX, etc.
Work: CR INRIA - computer arithmetic / SPACES project at LORIA


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

end of thread, other threads:[~2002-03-10  1:39 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-03-09  3:12 Titlebar-handling with zsh and screen Juhapekka Tolvanen
2002-03-09  5:12 ` Vincent Lefevre
2002-03-09  5:18   ` Clint Adams
2002-03-09 23:55     ` Vincent Lefevre
2002-03-10  1:38     ` Vincent Lefevre
2002-03-09  7:23 ` John Beppu

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