terminal
terminal copied to clipboard
New action `Restart this tab` in the tab's topbar context menu
Description of the new feature
This is useful when a tab is completely hung because of hung ssh session in a tab (e.g. happens when you have ssh connection, shut the laptop lid, then wake it up without wifi). In this state of ssh blocking in some I/O (under WSLv1 Ubuntu 24.04), the tab does not respond to any input, including Ctrl + Z and one has to wait for minutes until it prints client_loop: send disconnect: Connection reset by peer (I'll try using also the tilde commands, but they won't work for some other non-ssh I/O blocked tab anyways). If it's possible to also send some Linux signal into the tab (Ctrl+C or Ctrl+Z)
It is then useful to be able to restart this particular tab to not need to start a new one and then move it with a mouse to keep the tab order the same
Proposed technical implementation details
No response
Regarding Duplicate tab: currently the new duplicate tab gets placed at the right end of the topbar, not next to the duplicate tab. I would suggest that it the new tab should be placed right after the original one - just like in Chrome
We should probably put it in the menu.
For now, you can get at it with the command palette under the name "restart connection".
For Duplicate tab - also please consider creating the new tab right next to the old one (similar to Chrome) and not flushed to the right
And the other idea - is to be able to send some Linux signals (equivalent to Ctrl+C and Ctrl+Z) also directly from the context menu...
It looks like there is already code there for it here
Yea unless Im reading this wrong, this functionality already exists. If the current tab's connection IsClosed() it sets that menu Items Visibility to Visibile. Otherwise its Collapsed. Maybe there is a bug?
Seems to work
I'm proposing to always make this menu item available. My usecase is that some program (like ssh) hangs the tab completely, and I'd like to be able forcibly restart the tab (basically kill the existing tab, and create a new tab with the same profile at the same place in the tab bar) - even if the Terminal does not detect the tab as "restartable"
"Restart connection" is also a super strange naming for this...
@DHowett Whats your view on this?
Please do feel free to add it to the menu. However: it is a destructive action; should we guard it as such?
Yea I feel like this is a different use case. This is a process that is hung either on the remote session or possibly on the client side. It could be tricky to know which. Further, it could become a slippery slope to start killing processes. Id be hesitant to add a menu item that whose intention was to kill processes that we couldnt be 100% sure we knew was the culprit for the hung tab. Thats just my two pennies worth.
I suppose at the end of the day if we know what process is responsible for the tab we can restart that process as the tab is useless at that point anyway.
Do we even do that kind of book keeping?
Well, there is already a "destructive" option to close the tab (and restart the tab when the user wishes so isn't much different) , so the bookkeeping should be somewhere...
Sure just destroying and re-creating the tab would be fairly trivial (I think). Btw there is a setting currently available to always create new tabs next to the current tab instead of at the end of the tab row which is the default. Not sure if you were aware of that or not. That would solve at least part of this.