-
-
Notifications
You must be signed in to change notification settings - Fork 790
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
a "restart current SSH session" feature #4677
Comments
By the way, it's preferable for the tab title to remain unchanged before and after reconnecting via SSH. This is because the tab title before the disconnection might have been "carefully" renamed, and it would be bothersome to rename it again with each reconnection. |
@daishengdong I think you can try this feature After properly setup, you can simply |
@youngtuotuo The problem I described is precisely the one faced when establishing a connection in a new tab using the ssh_domain method; if I were to directly use "ssh name@ip" in a local shell, the tab for the local shell should not automatically close if the SSH connection drops. My current approach is to establish an ssh_domain connection in a new tab through showLauncher (bound to a shortcut key), and if the SSH connection is lost, the tab also closes. A more user-friendly way, as I described in my issue, is for the tab not to close automatically and to allow triggering a reconnection directly within this tab(better with a shortcut key). |
@youngtuotuo
What I meant to say is not that "when the tab closes, the SSH session can still be maintained in the background by a standalone thread", but rather that "when the SSH session/network connection is lost, the tab still won't close." AND, If necessary, you can directly re-initiate the SSH/network connection on this "unclosed tab". This doesn't require a separate thread, just a record of the relationship between the tab and the SSH domain, and providing an API that allows for the SSH connection to be directly re-initiated on the same tab.
Yes, tmux can solve some problems, but not all, as the local machine could also shut down or restart, leading to the loss of the local tmux session. The reason I'm making this feature request is that my work computer is a laptop, and my development machine is a remote server, so maintaining multiple ssh sessions is part of my daily development routine. When I move my laptop between different networks, the SSH connection will drop. If I have to go through the process of "1. using showLauncher to open SSH tabs, and 2. renaming the tabs to the name I want (since I have multiple remote servers)" every time, it becomes very annoying. If the tab could be preserved after the network disconnects, it would be much more convenient to just use a shortcut key to re-initiate the SSH connection. |
@daishengdong Got it. Sorry that I misunderstood your needs. I think your requirement is related to these (but not 100% aligned) Like this local wezterm = require "wezterm"
local mux = wezterm.mux
wezterm.on('gui-startup', function()
local _, first_pane, window = mux.spawn_window {}
local _, second_pane, _ = window:spawn_tab {domain = { DomainName = 'ubuntu' }}
local _, third_pane, _ = window:spawn_tab {domain = { DomainName = 'rasberrypi'}}
local _, fourth_pane, _ = window:spawn_tab { args = { 'ssh debian2' } }
-- this is also a startup command
second_pane:send_text "<insert busybox command>\n"
third_pane:send_text "top\n"
-- '\n' this will execute you shell command
end) Then every time you open wezterm, those tabs will automacically open. |
@youngtuotuo BTW, Tabby has the feature where every time it reopens, it automatically restores all tabs that were open at the time of the last close. |
Duplicate of #2080 |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
As a former long-term Tabby user, I feel that Tabby has some features that are more user-friendly, and I hope Wezterm can consider incorporating them:
In Tabby, if an SSH session in a tab disconnects, the tab doesn't automatically close (in Wezterm, it does), but instead, it indicates that the connection has been lost.
Additionally, Tabby offers a "restart current SSH session" feature that can be bound to a shortcut key.
This allows you to re-initiate the SSH connection directly within the same tab using the shortcut key, without having to reopen the tab.
This is very useful, for instance, when your computer moves between different network environments, causing SSH disconnections. If you had to reopen the tab each time, it would be quite bothersome.
The text was updated successfully, but these errors were encountered: