Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm currently setting tmux to update the window title to the name of the currently running command by doing the following:

set-option -g set-titles on
set-option -g set-titles-string '#S:#I.#P #W' # window number,program name,active (or not)
set-window-option -g automatic-rename on      # auto name

However, when no command is being executed, it just displays "N:zsh" (where N is the window number).

Is there a way to display the current last element of the path in the window title when no command is being executed? So, if the current path is /usr/src/linux, the window title should be "N:linux".

Thank you

share|improve this question

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.