dotfiles/.zsh/configs/tmux.zsh

23 lines
412 B
Bash
Raw Normal View History

2020-01-21 07:21:30 +00:00
_not_inside_tmux() {
[[ -z "$TMUX" ]]
}
_not_inside_phpstorm() {
if is_macos; then
2020-06-09 21:35:36 +00:00
# VS Code returns "vscode".
# iTerm returns "iTerm.app".
# PhpStorm returns nothing.
[[ "$TERM_PROGRAM" != "" ]]
elif is_linux; then
[[ "$TERMINAL_EMULATOR" != "JetBrains"* ]]
fi
}
2020-01-21 07:21:30 +00:00
ensure_tmux_is_running() {
if _not_inside_tmux && _not_inside_phpstorm; then
2020-01-21 07:21:30 +00:00
tat
fi
}
ensure_tmux_is_running