1

Looking at this SuperUser answer, I was able to default new windows names to '' by adding

bind c new-window -n ''

to the .tmux.conf file. It works for new windows during a session, but when starting a new tmux session with the tmux command, the first window still has the default name.

zx485
  • 2,337
ms2r
  • 11
  • 2

1 Answers1

0

when starting a new tmux session with the tmux command, the first window still has the default name.

The manual states:

If no commands are specified, the new-session command is assumed.

So bare tmux is equivalent to tmux new-session. You need it to be tmux new-session -n ''.


Create a wrapper script or a shell function that will pass the long command instead of sole tmux. Example function:

tmux () {
   if [ "$#" -eq 0 ]
      then command tmux new-session -n ''
      else command tmux "$@"
   fi
   }

Note this simple approach will "fix" bare tmux but not e.g. tmux -S foo. Adding logic in order to properly identify all such cases may not be trivial.