3

I'm trying to figure out how to get my gnome-terminal to launch run tmux -2 on starting. I have tried modifying the Exec lines in the gnome-terminal.desktop file to Exec=gnome-terminal -e -tmux -2 and to Exec="gnome-terminal -e -tmux -2" But I am having no luck. I have also tried similar things within my .zshrc file, but nothing seems to work, all that ever happens is a new gnome-terminal window running zsh will open.

Any help is appreciated.

1

1 Answer 1

2

In the gnome-terminal.desktop file, you need the Exec to contain the command exactly as you would run it via a shell. In this case, the gnome-terminal executable e parameter needs a quoted string to execute:

Exec=gnome-terminal -e 'tmux -2'
1
  • For those curious, if you wanted the Gnome Terminal to attach to an existing Tmux session if it exists, change the command to gnome-terminal -e 'tmux attach' and add this to your .tmux.conf as a new line new-session -n $HOST
    – Josiah
    Jul 21, 2017 at 19:57

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .