Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test: Terminal process revive #133516

Closed
4 tasks done
Tyriar opened this issue Sep 21, 2021 · 2 comments
Closed
4 tasks done

Test: Terminal process revive #133516

Tyriar opened this issue Sep 21, 2021 · 2 comments

Comments

@Tyriar
Copy link
Member

Tyriar commented Sep 21, 2021

Refs: #131634, #133512

Complexity: 4
Authors: @Tyriar, @meganrogge
Roles: Developer, Engineering Manager

Create Issue


When terminal processes are torn down when shutting down a window or the application it's now possible to store the buffer contents, restore it and "revive" the terminal process. The way this works is when closing a window it's evaluated whether this should persist, if so all relevant details are stored to disk and then when the same workspace is loaded, when the pty host connection is established the old processes are re-launched and then reconnected to using the same mechanism that regular process reconnection on window reload uses.

The settings that drive this feature:

  • terminal.integrated.persistentSessionReviveProcess: Whether to revive on application exit, window close or disable.
  • terminal.integrated.persistentSessionScrollback: The amount of buffer data to store

Here are some test cases to get you started:

  • Note that terminal editors do not currently support process revive Support process revive in terminal editors #133512
  • Test each terminal.integrated.persistentSessionReviveProcess setting value
  • Test in single folder and multi-root workspace
  • Fill the buffer and trigger process revive
  • Open the alt buffer (eg. run vim or tmux) and trigger process revive, the alt buffer should not be restored but whatever was in the normal buffer before opening vim should be. Note that on Windows this can end off looking wrong due to how conpty works for example the below shows a revive of a terminal with the process tree pwsh -> wsl -> vim:
    image
    We cannot easily detect this case though so it's by design currently.
  • The amount of lines restored should be controllable via the terminal.integrated.persistentSessionScrollback setting
  • Window reload process reconnect should still work
  • Process revive should restore buffer contents when the application is shutdown due to a config change (eg. change update.mode). Note regular process reconnect can't work here because the whole application is taken down in case the setting change affects the main/shared proc.
  • Make sure the session restored message looks good on various themes
  • Feedback on the setting and feature name is welcome
@karrtikr
Copy link
Contributor

the buffer contents, restore it and "revive" the terminal process
Fill the buffer and trigger process revive

I'm not clear on what "buffer" and "terminal process" means from user's perspective, can you clarify? An example of a process I can launch, or how to "fill the buffer" would help.

For me as long as terminal.integrated.enablePersistentSessions is set to true, whatever I type or launch in the terminal is restored even on VSCode stable, so I'm not sure what that means.

@meganrogge
Copy link
Contributor

@karrtikr sorry for the confusion.

buffer just means terminal input and output
terminal process means anything running in the terminal - yarn watchd for example

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants