In my tmux.conf
file I have it configured to open windows, name them, setup panes etc.. etc..
However one issue I have is that if one of the panes launches a command, let's say ls
, then the pane closes itself after the command completes (instantly). Is there any way to prevent this behavior? Or have it drop to a normal shell after a command completes?
I am assuming that I need to start a shell -> execute command when the pane launches, but I'll be damned if I can figure out how. I have googled a bit for this problem but have come up short.
Best Answer
You have a couple of options.
Instead of running
ls
in your window, run a shell, then send the shell keystrokes to execute:You can lunch a sequence of commands in such a way as to leave yourself with a bash shell after your other commands have run:
See jasonwryan's answer for details on the
remain-on-exit
option to keep panes alive after their process has exited so you can review the output.If the output of some command was worth seeing once, it might be worth refreshing. If you are monitoring the output of something you can
watch
to periodically get new output. This should play nicely with panes intmux
: