/ split_man
split_man
1 #!/usr/bin/env bash 2 3 # Check if gum is available 4 if ! test -x "$(command -v gum)"; then 5 echo "Missing dependency: gum" 6 echo "See https://github.com/charmbracelet/gum" 7 exit 1 8 fi 9 10 CMD=$(gum input --placeholder="command") 11 12 if [[ -n "$BYOBU_BACKEND" && "$BYOBU_BACKEND" = "tmux" ]]; then 13 byobu-tmux split-window -h man "$CMD" 14 elif [[ -n "$TMUX" ]]; then 15 tmux split-window -h man "$CMD" 16 elif [[ -n "$ZELLIJ" ]]; then 17 zellij action new-pane -- man "$CMD" 18 else 19 echo "No byobu, tmux, or Zellij sessions detected" 20 exit 1 21 fi