vscode-ocaml-platform icon indicating copy to clipboard operation
vscode-ocaml-platform copied to clipboard

On remote hosts, `Open a sandboxed terminal` does not restore sandboxed terminal after disconnect-then-reconnect

Open mbacarella opened this issue 4 years ago • 6 comments

Repro

  1. Open a project on a remote host that uses an opam local switch
  2. You can open a sandboxed terminal and run commands from that terminal local to that switch 😀
  3. However, if you close the ~~project~~ folder and re-open it
  4. 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

mbacarella avatar Dec 10 '21 23:12 mbacarella

However, if you close the project and re-open it

How does one close a project?

@mnxn any idea what this bug might be?

rgrinberg avatar Jan 30 '22 06:01 rgrinberg

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.

mbacarella avatar Jan 30 '22 12:01 mbacarella

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?

ulugbekna avatar Jan 30 '22 16:01 ulugbekna

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.

mlantas avatar Jan 30 '22 20:01 mlantas

I assume this is a related issue at the VS Code project: https://github.com/microsoft/vscode/issues/142826

mbacarella avatar Mar 02 '22 18:03 mbacarella

The linked issue was closed with a fix in the VS Code project. Maybe this will work now...

mbacarella avatar Jun 14 '22 21:06 mbacarella