strom/fish-misc
Archived
1
0
Fork 0
This repository has been archived on 2023-08-27. You can view files and clone it, but cannot push or open issues or pull requests.
fish-misc/functions/_is_tmux.fish

11 lines
340 B
Fish

# vim: ft=fish ts=4 sw=4 noet
function _is_tmux --description 'returns true if run inside tmux session'
set -l ps_res (ps -p (ps -p %self -o ppid= | xargs -n 1) -o comm=)
if string match -q -- "tmux*" $ps_res
return 0
end
return 1
# set -l tsock (string split ',' "$TMUX")
# if ! [ -S "$tsock[1]" ] # we are not attached
# end
end