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.

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'
| improve this answer | |
  • 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 '17 at 19:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.