On remote hosts, `Open a sandboxed terminal` does not restore sandboxed terminal after disconnect-then-reconnect
Repro
- Open a project on a remote host that uses an opam local switch
- You can
open a sandboxed terminaland run commands from that terminal local to that switch 😀 - However, if you close the ~~project~~ folder and re-open it
- The terminal that gets restored is a regular terminal, not a sandboxed terminal 😞
Expected behavior
The restored terminal behaves just the same as a initial sandboxed terminal
However, if you close the project and re-open it
How does one close a project?
@mnxn any idea what this bug might be?
However, if you close the project and re-open it
How does one close a project?
I meant the folder. Fixed the description in the bug report.
The same behavior is observed without remote host involvement, ie if I open some project user/foo, set the extension sandbox to a local switch user/bar, open a terminal for current sandbox, close and reopen vscode, I get a terminal with switch set to a global switch (ie different from the sandbox it was created with initially). Is that the problem?
Restoring terminals is a VS Code feature: https://code.visualstudio.com/updates/v1_54#_retain-terminal-processes-on-window-reload.
I might be wrong, but I don't think there's any API that lets us configure how terminals are restored.
I assume this is a related issue at the VS Code project: https://github.com/microsoft/vscode/issues/142826
The linked issue was closed with a fix in the VS Code project. Maybe this will work now...