fallback to standard emacsclient if rtramp cannot find tunneled emacs
this also checks to make sure you are in an ssh session, since it needs the ssh connection information to form the tramp line anyways for this to properly detect the tunnel being severed, you must set StreamLocalBindUnlink to yes in your sshd_config, which will delete ("unlink") the unix socket after the ssh session closes
This commit is contained in:
parent
0c0470ec49
commit
65826ac3c6
12
bin/rtramp
12
bin/rtramp
|
@ -1,6 +1,10 @@
|
|||
#!/bin/sh
|
||||
|
||||
for fn in "$@"; do
|
||||
real=$(realpath "$fn" || echo "$fn")
|
||||
printf "/ssh:%s@%s:%s\0" "$USER" "$(echo $SSH_CONNECTION | cut -d' ' -f3-4 | tr ' ' '#')" "$real"
|
||||
done | xargs -0 emacsclient -s ~/.sshemacs
|
||||
if [ -S ~/.sshemacs -a -n "$SSH_CONNECTION" ]; then
|
||||
for fn in "$@"; do
|
||||
real=$(realpath "$fn" || echo "$fn")
|
||||
printf "/ssh:%s@%s:%s\0" "$USER" "$(echo $SSH_CONNECTION | cut -d' ' -f3-4 | tr ' ' '#')" "$real"
|
||||
done | xargs -0 emacsclient -s ~/.sshemacs
|
||||
else
|
||||
emacsclient "$@"
|
||||
fi
|
||||
|
|
Loading…
Reference in New Issue