0

i added the tmux plugin to my .zshrc file and when i try to make it run on startup with TMUX_AUTOSTART=true it'll just shows the terminal window and disappears under a second. then i open it again and i can work. again after a while if i close the terminal and try to run it again it might happen or it might run correctly and let me work it's getting really annoying. and when i try other code to run tmux on start up like these:

if command -v tmux &> /dev/null && [ -n "$PS1" ] &&
          [[ ! "$TERM" =~ screen ]] && [[ ! "$TERM" =~ tmux ]] &&
          [ -z "$TMUX" ]; then
    exec tmux
fi

or

[[ $- != *i* ]] && return

[[ -z "$TMUX" ]] && exec tmux

or

[ -z "$TMUX"  ] && { tmux attach || exec tmux new-session && exit;}

or any other code, the terminal just opens up and close itself in under a second for ever. It closes every time then.

1 Answer 1

2

You have to put your ZSH_TMUX_AUTOSTART between your plugins and your oh-my-zsh source.

Like this:

plugins=(tmux)

ZSH_TMUX_AUTOSTART=true

source $ZSH/oh-my-zsh.sh

1
  • that's exactly where it is already Jul 18, 2020 at 15:05

You must log in to answer this question.

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