-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stops working when tmux-ssh-split creates a new pane. #14
Comments
Hi, Indeed it's possible that there's something wrong in either of our plugins. I suggest opening an issue there as well. This plugins is a bit hackish and reads the command executed in the pane. It might be that we only need to quick fix the list at : https://github.com/soyuka/tmux-current-pane-hostname/blob/master/scripts/shared.sh#L98-L103 |
I've commented on this on my repo:
|
The linked code is out of date (discovered a bug). Here's what you want to really do: ssh_connected() {
local child_cmd
local pane_id
local pane_pid
pane_id="${1:-$(get_current_pane_id)}"
pane_pid="$(get_pane_pid_from_pane_id "$pane_id")"
if [[ -z "$pane_pid" ]]
then
echo "Could not determine pane PID" >&2
return 3
fi
ps -o command= -g "${pane_pid}" | while read -r child_cmd
do
if [[ "$child_cmd" =~ ^(auto)?ssh.* ]]
then
return 0
fi
done
return 1
} |
Yeah. I've done my part. ;) |
@stormsz may you try the patched version ? Maybe that we could just do:
I'm not confident using |
As mentioned above this won't work. You have to use
I've never ever encountered a unix-y system where |
BTW you are already using
|
Yo guys. Sorry for the delay, borked my system and had to do some restores from backups. I have implemented the new code change that @pschmitt suggested to the |
This wasn't meant to be used verbatim. Otherwise I'd have sent a PR. |
Oh, goddamit I'm dumb. let me see what i can do. |
Did you ever get this merged in? it would make life somewhat easier when sshing all over the place :) |
The tmux-ssh-split is a plugin that allow us to, when inside an SSH pane, press the split key and it will create a new pane already ssh'ed in. (so we dont have to always ssh server_with@tmux_from_3years_ago).
This plugin seems to break when a new split is created, the hostname will revert back to the hostname where the tmux server is running and not the remote server.
Also I'm not sure if its a problem with this plugin or the ssh-split plugin, but since this is the one that breaks i created the issue here.
TMUX version: tmux 3.0a
Tested everything on Ubuntu WSL
EDIT:
after further testing i have noticed some things:
Since i have created a new pane from the hosting machine and then SSH'ed in and the hostname updated to the hostname of the remote, this leads me to believe that is the tmux-ssh-split messing something. Should i create an issue there instead?
The text was updated successfully, but these errors were encountered: