2020-01-21 07:21:30 +00:00
|
|
|
_not_inside_tmux() {
|
|
|
|
[[ -z "$TMUX" ]]
|
|
|
|
}
|
|
|
|
|
2020-06-09 20:24:12 +00:00
|
|
|
_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.
|
2020-06-09 20:24:12 +00:00
|
|
|
[[ "$TERM_PROGRAM" != "" ]]
|
|
|
|
elif is_linux; then
|
|
|
|
[[ "$TERMINAL_EMULATOR" != "JetBrains"* ]]
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-01-21 07:21:30 +00:00
|
|
|
ensure_tmux_is_running() {
|
2020-06-09 20:24:12 +00:00
|
|
|
if _not_inside_tmux && _not_inside_phpstorm; then
|
2020-01-21 07:21:30 +00:00
|
|
|
tat
|
|
|
|
fi
|
|
|
|
}
|
2020-05-12 23:58:34 +00:00
|
|
|
|
|
|
|
ensure_tmux_is_running
|