nix/bin/tmux-session-dir

10 lines
275 B
Plaintext
Raw Normal View History

2023-09-05 13:52:52 -05:00
#!/usr/bin/env sh
# if inside a session, use the current session
# if not, a session must be specified after the dir
d="${1}"
[ -z "$d" ] && d="#{pane_current_path}"
target_session="${2}"
[ -n "$TMUX" ] && target_session="."
tmux attach-session -t "$target_session" -c "$d"