Files
oh-my-bash/plugins/tmux-autoattach/tmux-autoattach.plugin.sh
Wes Key e327e66c02 removed checks and updated read me
- checks have been removed to in favor of conditional plugin loading
- .gitignore has been updated to ignore .tmp files
- main README has been updated to reflect conditional plugin loading
- tmux-autoattach plugin README has been updated to reflect
  conditional plugin loading options
2021-12-24 22:03:05 +09:00

25 lines
536 B
Bash

# @chopnico 2021
#
# tmux-autoattach.plugin.sh
#
# A tmux plugin that will automatically attach itself to a bash session.
[ -z "$OSH_PLUGIN_TMUX_AUTOATTACH_BEHAVIOR" ] && OSH_PLUGIN_TMUX_AUTOATTACH_BEHAVIOR="detach"
_osh_plugin_tmux_autoattach_exit() {
[ -z "$TMUX" ] && tmux -2u new -A && exit
}
_osh_plugin_tmux_autoattach_detach() {
[ -z "$TMUX" ] && tmux -2u new -A
}
case "$OSH_PLUGIN_TMUX_AUTOATTACH_BEHAVIOR" in
"exit")
_osh_plugin_tmux_autoattach_exit
;;
"detach" | *)
_osh_plugin_tmux_autoattach_detach
;;
esac