wavetermdev / waveterm

An open-source, cross-platform terminal for seamless workflows
https://www.waveterm.dev
Apache License 2.0
3.9k stars 92 forks source link

Inquiry Regarding Session Persistence Feature in Waveterm #747

Open wayenH opened 1 month ago

wayenH commented 1 month ago

I am a user of your excellent terminal tool, Waveterm, and I am writing to seek clarification on a particular feature mentioned in the help documentation.

According to the documentation, Waveterm supports a session persistence feature. This feature is supposed to maintain the session environment and history by installing a program called Waveshell on the remote machine, allowing for a persistent connection. My understanding from the documentation is that this functionality is similar to tmux or screen, where even if the network is disconnected or Waveterm is closed unexpectedly, the remote machine's session will remain active, and the tasks running on it will continue. Upon reconnecting with Waveterm, we should be able to resume the previous session seamlessly.

However, in practice, I have observed that when the network is disconnected or Waveshell is restarted, the remote machine's login session is still closed, and the running tasks are terminated. This behavior contrasts with my understanding of the session persistence feature.

I would like to clarify the following points:

Does the session persistence feature indeed function similarly to tmux or screen, allowing the remote machine's session and tasks to remain active even after network disconnections or unexpected Waveterm closures? If the feature does work this way, are there any specific steps or configurations required to ensure that the session persistence feature operates correctly? Could this issue be due to any mistakes in my configuration or usage?

sawka commented 4 weeks ago

For Wave, "session persistence" means completely restoring the state of the shell across disconnects. This includes things like current working directory, environment variables, aliases, functions, history etc. So if you were in a virtual environment or if you had set some environment variables, then the next command you ran in that session would still have access. It also applies to history, so your "up arrow" will always be the last command run in the session (not some combined history file).

Currently Wave does not support "tmux" or "screen" like persistence of processes. This is possible with the current architecture, but it is not something that we've implemented yet. As you mentioned it would involve daemonizing the waveshell process, and then allowing the main wave client to be able to reconnect to it (and also appropriate buffering of output).