Keeping the browser terminal session connected
-
wrote on Dec 25, 2024, 6:46 PM last edited by joseph Jan 1, 2025, 11:27 AM
Many times there is a need to keep multiple browser terminal sessions open across different apps and systems and the information from one is necessary for the other.
However it's super frustrating when some timeout happens and reloads the terminal w/o warning. This results in a loss of all the accumulated information in that session and requires a long redo process.
How do we prevent the websockets from timing out?
Why isn't there a keepalive?Can we improve the reconnect as a keepalive instead?
-
I can't find an obvious explicit timeout, maybe the browser suspends the tab or so? How long a timeout are we roughly talking about and does this also happen if you use the cloudron cli tool to open a terminal into the app? Will keep some terminal tabs open to see if I can reproduce this easily, so far I haven't at least noticed it.
-
wrote on Dec 25, 2024, 11:23 PM last edited by robi Dec 25, 2024, 11:23 PM
I ran a script to time it and output the date command to a file every second.
It started and finished with these two entries:
Wed Dec 25 23:14:07 UTC 2024 ... Wed Dec 25 23:21:12 UTC 2024
The tab did not go to sleep.
-
wrote on Dec 26, 2024, 12:40 AM last edited by
It's odd, I just tried it in Brave (the previous was in Iron) and it lasted a lot longer:
Thu Dec 26 00:22:16 UTC 2024 ... Thu Dec 26 00:36:05 UTC 2024
-
App Devwrote on Dec 26, 2024, 7:24 PM last edited by Kubernetes Dec 26, 2024, 7:26 PM
You should use tmux or gnu screen for that use case
https://www.gnu.org/software/screen/manual/screen.html
https://github.com/tmux/tmux/wikiI prefer tmux myself.
Ah, sorry, you are talking about the browser shells only?
-
wrote on Dec 27, 2024, 8:29 AM last edited by
Yes, I believe he is and I‘ve noticed the same annoyance a couple of times. I think it depends on your specific browser and how it handles power management.
-
Yes, I believe he is and I‘ve noticed the same annoyance a couple of times. I think it depends on your specific browser and how it handles power management.
wrote on Dec 28, 2024, 10:52 PM last edited by@Kubernetes TY, I made it clearer in the OP.
@necrevistonnezr Thanks for the hint. I am trying out the Staying Alive extension to see if it does the trick for the domain or just the terminal sessions.
-
wrote on Dec 29, 2024, 12:04 AM last edited by
No go so far with the extension.
Console log shows:
Uncaught Error: Could not dispose an addon that has not been loaded at Proxy._wrappedAddonDispose (terminal-BYZevxTX.js:8:31585) at l.dispose (terminal-BYZevxTX.js:8:31403) at WebSocket.<anonymous> (terminal-BYZevxTX.js:9:1319) terminal-BYZevxTX.js:9 Socket closed. Reconnecting... cs.js:65
-
Do you happen to have anything like Cloudflare proxy in front of your system? Maybe that gets into the way?
-
wrote on Dec 29, 2024, 9:37 PM last edited by
Not sure what else to provide other than flip the script and revisit the OP asking what can we do to make the browser keep thinking it's alive? Send NOOPs?
-
Do other solutions, like for example guacamole suffer from the same issue?
I think i am personally leaning towards using the cloudron cli, as this way I can use tmux for persistence and can even share the session. I had tabs crashing because too much memory was used and a reload will always start a new session.
-
-
wrote on Jan 21, 2025, 8:38 AM last edited by
Using worpdress managed app, after ~90 seconds of inactivity the terminal resets and shows "Reconnecting..." and then the first line.
I can be trying to write a mysql query and loose all progress.
I'd love a solution to keep the session live. -
wrote on Jan 21, 2025, 10:04 AM last edited by
Sorry, i should have checked that first.
Downgrading CF proxy to DNS only does seem to fix the issue for me.
Thanks @nebulon. -