Util : Add _is_tmux.
This commit is contained in:
parent
b2b937b40f
commit
72cf1056e8
|
@ -11,7 +11,7 @@ function ta() {
|
||||||
tmux new-session -s "${name}" -d &> /dev/null
|
tmux new-session -s "${name}" -d &> /dev/null
|
||||||
|
|
||||||
# Attach to session.
|
# Attach to session.
|
||||||
if [[ "${TERM_PROGRAM}" = "tmux" ]]; then
|
if _is_tmux; then
|
||||||
tmux switch-client -t "${name}"
|
tmux switch-client -t "${name}"
|
||||||
else
|
else
|
||||||
tmux attach-session -t "${name}"
|
tmux attach-session -t "${name}"
|
||||||
|
|
|
@ -116,3 +116,8 @@ function _contains() {
|
||||||
|
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Check if inside Tmux.
|
||||||
|
function _is_tmux() {
|
||||||
|
[[ "${TERM_PROGRAM}" = "tmux" ]]
|
||||||
|
}
|
||||||
|
|
Reference in a new issue