Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

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

How can I make tmux to set pane_title automatically to currently running command?

Actually the setting automatic-rename is just what I want for pane_title, but for it's only for window_name.

share|improve this question

This is very similar to a question answered on StackOverflow. Since you want the current command, rather than the last command, the easiest thing to do is use a wrapper function to update the pane title.

panewrap () { printf "\033]2;%s\033\\" "$1"; "$@"; }

By prefixing all your commands with calls to panewrap, your tmux status bar will be updated before each command is run.

share|improve this answer
    
This is almost what I want. This the last executed command. I need the currently running command. For example when I execute python repl. – Epeli May 13 '12 at 19:37
    
See updated answer. – CodeGnome May 14 '12 at 12:43
    
Where would one put this code? – oneself Sep 9 '15 at 22:00

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .