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 would like to have a tmux pane where everytime I switch to it runs a command like git diff so that everytime I switch to it I see a new version of the output. Can this be done?

share|improve this question

bind-key C-G select-pane -t 1 \; send-keys "git diff" ENTER

This relies on the pane being number 1. So, if you are doing some work in another pane, and you want to switch over and do this real quick, it will switch and run the command.

You could also simply send the command to the pane without needing to actively switch into it. But this is the closest thing to honoring your question that I can currently come up with.

Note: The capitalized ENTER at the end is important otherwise you simply end up with the git diff standing there.

share|improve this answer

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.