dotfiles/.zsh/configs/tmux.zsh
2021-06-10 12:18:43 +01:00

23 lines
412 B
Bash

_not_inside_tmux() {
[[ -z "$TMUX" ]]
}
_not_inside_phpstorm() {
if is_macos; then
# VS Code returns "vscode".
# iTerm returns "iTerm.app".
# PhpStorm returns nothing.
[[ "$TERM_PROGRAM" != "" ]]
elif is_linux; then
[[ "$TERMINAL_EMULATOR" != "JetBrains"* ]]
fi
}
ensure_tmux_is_running() {
if _not_inside_tmux && _not_inside_phpstorm; then
tat
fi
}
ensure_tmux_is_running