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.

muru
  • 193,181
  • 53
  • 473
  • 722
Nik
  • 33
  • 1
  • 4

1 Answers1

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'
muru
  • 193,181
  • 53
  • 473
  • 722
theferrit32
  • 551
  • 4
  • 9
  • 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