I have a section in my .bashrc that fires up the tmux program (terminal multiplexor).
However if the tmux program isn't installed (say I'm setting up a new computer) then having this in my .bashrc file stops any terminal window from successfully opening at all.
Of course installing tmux fixes this, but that isn't my problem.
How can I make this conditional so that if tmux isn't installed it doesn't crap out / give an error message?
Currently I have:
if [[ ! $TERM =~ screen ]]; then
exec tmux
fi
I want something like:
if tmux; then
if [[ ! $TERM =~ screen ]]; then
exec tmux
fi
fi
but that gives me
The program 'tmux' is currently not installed. You can install it by typing:
sudo apt-get install tmux
Though it does at least give me a terminal prompt instead of closing the window! Also if/when tmux is installed this doesn't give any error / cause any issue when opening a new terminal window.