DEV Community

Play Button Pause Button
Waylon Walker
Waylon Walker

Posted on • Updated on • Originally published at waylonwalker.com

tmux command line

So far we have covered a lot of tmux commands and how they map to keybindings but these same commands can be executed at the command line.

From the command line

Let's make a popup that displays our git status for 5s or until we close it manually. We can run the following command at the command line, in a split.

tmux display-popup -E -d '#{pane_current_path}' 'git status && sleep 5'
Enter fullscreen mode Exit fullscreen mode

From the tmux command line

Or we can open the tmux command line and run it from tmux's built in command line, which is very similar to bim EX mode. By default the tmux command line
can be opened with prefix+[.

display-popup -E -d '#{pane_current_path}' 'git status && sleep 5'
Enter fullscreen mode Exit fullscreen mode

πŸ—’οΈ note that the tmux command is called by default when inside of tmux.

Make it a keybinding

Finally we can make it a keybinding by adding a bind command ahead of our tmux command, then we can execute this in the tmux command line or add it to our
~/.tmux.conf.

bind s display-popup -E -d '#{pane_current_path}' 'git status && sleep 5'
Enter fullscreen mode Exit fullscreen mode

Be sure to check out the full youtube playlist and subscribe if you like it.

tmux playlist on youtub

Also check out this long form post for more about how I use tmux.

Top comments (0)