summaryrefslogtreecommitdiff
path: root/bin/ssh-and-tmux
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2022-06-20 10:15:41 -0700
committerSean Whitton <spwhitton@spwhitton.name>2022-06-20 17:52:47 -0700
commitf9e9d3cd4d158f5756ea45aabe02cb998d85ec34 (patch)
tree71a313f3aa826aae7890cacc379247c6569b2a72 /bin/ssh-and-tmux
parentbb18ee1105e806f119509d73acb37de82c194a0d (diff)
downloaddotfiles-f9e9d3cd4d158f5756ea45aabe02cb998d85ec34.tar.gz
fix PATH for root tmux daemons launched by ii, ssh-and-tmux scripts
Diffstat (limited to 'bin/ssh-and-tmux')
-rwxr-xr-xbin/ssh-and-tmux6
1 files changed, 5 insertions, 1 deletions
diff --git a/bin/ssh-and-tmux b/bin/ssh-and-tmux
index 87ace865..6f1d482e 100755
--- a/bin/ssh-and-tmux
+++ b/bin/ssh-and-tmux
@@ -24,7 +24,11 @@ done
host="$1"
session="${2:-default}"
-cmd="tmux new-session -A -c \$HOME -s $session"
+# Go via a login shell such that if there is no root tmux daemon yet, it ends
+# up with a PATH as though the first tmux session were launched from an
+# interactive shell. This affects launching programs directly from tmux
+# (e.g. my C-\ e binding) for *all* sessions.
+cmd="\$SHELL -l -c \"tmux new-session -A -c \$HOME -s $session\""
if [ -n "$container_name" ]; then
display_host="$container_name"
cmd="$(printf "$container_cmd" "$container_name") -- $cmd"