[feature request] Keep windows alive on connection loss #10

Closed
opened 2025-12-08 07:40:16 -06:00 by peterbjorgensen · 9 comments
peterbjorgensen commented 2025-12-08 07:40:16 -06:00 (Migrated from github.com)

Thanks for a very useful program. I use it with alacritty and sway.
When I lose connection to the remote server all the windows disappear. They will come back on reconnect, but the layout get messed up because the windows respawn. I don't know if it's possible to make the windows persistently open with the current architecture? Ideally they should become blank or say "lost connection" or something until the connection is back.

Thanks for a very useful program. I use it with alacritty and sway. When I lose connection to the remote server all the windows disappear. They will come back on reconnect, but the layout get messed up because the windows respawn. I don't know if it's possible to make the windows persistently open with the current architecture? Ideally they should become blank or say "lost connection" or something until the connection is back.
zdykstra commented 2025-12-08 09:18:42 -06:00 (Migrated from github.com)

Thank you for the feature request! This is a good idea that I'd like to make work, if possible. I have a couple of ideas on how this can be accomplished - I'll try to test them this week on a laptop that routinely suspends/resumes.

Thank you for the feature request! This is a good idea that I'd like to make work, if possible. I have a couple of ideas on how this can be accomplished - I'll try to test them this week on a laptop that routinely suspends/resumes.
zdykstra commented 2025-12-08 22:28:42 -06:00 (Migrated from github.com)

I've put an hour or two into this problem tonight - I'm not entirely convinced that this solution is the correct way to do it. However my limited testing of this shows that open windows survive the control master session dropping. Check + reconnection logic has been pushed into the shell script that each terminal runs. It's currently only implemented for multi-window mode. Single window mode will take a substantial refactor, if it's at all possible with the current design.

If you're feeling brave, please give https://github.com/zdykstra/tmuxc/tree/business-hammock-district a try and let me know if it works for you, breaks badly for you under certain circumstances, etc.

I've put an hour or two into this problem tonight - I'm not entirely convinced that this solution is the correct way to do it. **However** my limited testing of this shows that open windows survive the control master session dropping. Check + reconnection logic has been pushed into the shell script that each terminal runs. It's currently only implemented for multi-window mode. Single window mode will take a substantial refactor, if it's at all possible with the current design. If you're feeling brave, please give https://github.com/zdykstra/tmuxc/tree/business-hammock-district a try and let me know if it works for you, breaks badly for you under certain circumstances, etc.
peterbjorgensen commented 2025-12-09 11:29:40 -06:00 (Migrated from github.com)

Thanks. I will try it out tomorrow.

Thanks. I will try it out tomorrow.
peterbjorgensen commented 2025-12-12 11:58:02 -06:00 (Migrated from github.com)

I have been using the branch for the last 4 days and so far everything works as intended.

I have been using the branch for the last 4 days and so far everything works as intended.
zdykstra commented 2025-12-12 12:07:18 -06:00 (Migrated from github.com)

Great! I'll clean things up a bit and get it all ready to ship in a new release. This behavior will likely be put behind a config option/flag, with the older behavior staying the default.

Great! I'll clean things up a bit and get it all ready to ship in a new release. This behavior will likely be put behind a config option/flag, with the older behavior staying the default.
zdykstra commented 2026-04-23 12:11:46 -05:00 (Migrated from github.com)

I haven't been able to come back to this, life is pretty busy. @peterbjorgensen are you still using this and does it continue to work as expected for you?

I haven't been able to come back to this, life is pretty busy. @peterbjorgensen are you still using this and does it continue to work as expected for you?
ClashTheBunny commented 2026-04-25 10:37:54 -05:00 (Migrated from github.com)

Does this work for localhost? I get "Waiting for SSH session to become available" constantly in the window that opens when I start my local terminal.

Does this work for localhost? I get "Waiting for SSH session to become available" constantly in the window that opens when I start my local terminal.
peterbjorgensen commented 2026-05-04 06:43:37 -05:00 (Migrated from github.com)

@zdykstra I am still using this. It still works fine. I have not tested it on localhost.

@zdykstra I am still using this. It still works fine. I have not tested it on localhost.
Owner

Too many edge cases / too invasive. Not consider this at the moment.

Too many edge cases / too invasive. Not consider this at the moment.
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
zdykstra/tmuxc#10
No description provided.