I have a command in my .tmux.conf
file which checks to see if a directory exists, then displays a message if it doesn't; and another command which tries to run a shell script.
file: ~/.tmux.conf
# do a check and display message if non-zero exit
if-shell "! [-d $HOME/.tmux]" 'display-message "tmux plugins are not installed"'
# try run a shell script
run-shell ~/.tmux/plugins/tmux-resurrect/resurrect.tmux
The problem is that tmux won't display any messages that are generated during startup - which is the time I would expect diagnostic errors and warnings to be generated.
What I start tmux, I get an error message in tmux's pager
(null):0: no current session
where it's clearly not liking being sent messages.
If I run the same commands by using source-file ~/.tmux-conf
in the middle of a tmux session, all messages are reported successfully.
How can I get tmux to report messages during startup?