Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: the konsole title bar

On Saturday 28 July 2007, pol wrote:
> I am using the following command in /etc/zsh/zshrc to change the title bar
> and tab bar according to the current directory:
> precmd () {
>      tab_lable="$PWD:h:t/$PWD:t"
>      rlength="20"   # number of characters to appear before truncation from
> the left
>     dcop "$KONSOLE_DCOP_SESSION" renameSession "$tab_lable[-$rlength,-1]"
>     }
> When running vim, the running command is added to  <current dir>, in the
> title and tab names.
> However, as vim has been closed, title bar and tab name take the form:
> <current dir> Konsole <current dir>

may be you mean <current dir> - <current dir> - Konsole

at least that is what I get in such case.

> That is not what expected
> What is wrong?

There are session name and window title. Some programs do set window title; 
this is relatively portable in the sense it works on xterm and derivatives as 
well as konsole and even cygwin as far as I remember. Windows title set this 
way comes before session name.

what you could do

a) configure all programs you use to no set window title. This may be 
impossible (e.g. sometimes I log in remotely in a system where I simply do 
not have any way to turn this off).

b) set session name to some "innocent" fixed string and use window title 
instead yourself. Setting session name to empty string gives ugly:

<your window title> - - Konsole

may be it is possible to turn session name and Konsole off completely but I 
cannot find it. 

Oh, and you set window title with

  print -nP -u2 '\033]0;<your title goes here>\a

Attachment: signature.asc
Description: This is a digitally signed message part.

Messages sorted by: Reverse Date, Date, Thread, Author