* John Magolske <listm...@b79.net> [120805 23:40]:
> > * John Magolske <listm...@b79.net> [120801 09:15]:
> > > I'm trying to get the title of the active pane in the status line to
> > > display $PWD when no command is active, and the current command when
> > > a command is active. So, for example, if I cd to ~/Mail in the active
> > > pane of window 7 the status line would be simply: 7*Mail
> > > 
> > > Then if I invoke the vifm file browser:  7*vifm
> > > [...]
> 
> ~/.zshrc :
>   preexec () {
>       local CMD=${1[(wr)^(*=*|sudo|ssh|-*)]}
>       [[ "$TERM" == tmux* ]] && printf "\033]2;$CMD\033\\"
>   }
>   precmd () {
>       [[ "$TERM" == tmux* ]] && printf "\033]2;`basename ${PWD}`\033\\"
>   }
> 
> ~/.tmux.conf :
>   setw -g window-status-current-format '#I#F#T '
>   setw -g window-status-format '#I#F#T '
> 
> This works fairly well, but I'm not finding a way to set the title
> of windows created using the "new-window" command. ... does not allow
> for the more customized titles with Vim using "set titlestring=..."
> in ~/.vimrc (just shows "vim" as the window title).

Taking a closer look at the NAMES AND TITLES section of the tmux
manpage, I see there are different escape sequences for window names
and pane titles. So now, doing this:

~/.zshrc :
  preexec () {
      local CMD=${1[(wr)^(*=*|sudo|ssh|-*)]}
      [[ "$TERM" == tmux* ]] && printf "\033k$CMD\033\\"
  }
  precmd () {
      [[ "$TERM" == tmux* ]] && printf "\033k`basename ${PWD}`\033\\"
  }

~/.tmux.conf :
  setw -g window-status-current-format '#I#F#W '
  setw -g window-status-format '#I#F#W '

Makes everything works perfectly.

John

-- 
John Magolske
http://B79.net/contact

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users

Reply via email to