waveterm icon indicating copy to clipboard operation
waveterm copied to clipboard

Inquiry Regarding Session Persistence Feature in Waveterm

Open wayenH opened this issue 1 year ago • 5 comments

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?

wayenH avatar Aug 05 '24 07:08 wayenH

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).

sawka avatar Aug 16 '24 01:08 sawka

with the latest version "current working directory" does not seem to work on local shells at least ; the shell output does show where it was last, then "process finished with error code = -1", and after restoring it ends up in $HOME

tjaalton avatar Nov 05 '24 15:11 tjaalton

Hi Have been using Wave since October - loving it. However, I have never been able to make the session restoration work fully as it seems it should be working based on description above.

What I mean is, if I:

  1. Open Wave, type a command, let's say cd /etc
  2. Close the Wave app fully
  3. Reopen Wave app
  4. I can see message (restored terminal state) in terminal printed, and I can see above that I was in /etc before
  5. But my current path is not /etc and if I press Up arrow on keyboard, I do not see anything in the history
SCR-20241213-joif

Not sure if Wave was supposed to restore path / history in that scenario?

uson1x avatar Dec 13 '24 07:12 uson1x

Same here. I really like the Wave-Terminal. The last used directory should be “opened” again at startup. Instead, I always start in my home directory. I actually thought that this would work with the workspaces, but unfortunately the same behavior occurs there.

gest01 avatar Feb 05 '25 07:02 gest01

this is working for me now with 0.12.5

tjaalton avatar Dec 08 '25 12:12 tjaalton