Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

1 Answer 1

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

 
discard

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.