posit-dev / positron

Positron, a next-generation data science IDE
https://positron.posit.co
Other
2.85k stars 91 forks source link

Positron Web: `POSITRON_MODE` env var showing `desktop` in Terminal #5162

Open sharon-wang opened 1 month ago

sharon-wang commented 1 month ago

System details:

Positron and OS details:

Positron Server Web dev build from main branch or any of the latest REH-Web release builds.

Interpreter details:

N/A

Describe the issue:

On Web, POSITRON_MODE shows server as expected in the R Console and Python Console, but in the Terminal it shows desktop.

No issues on Desktop: POSITRON_MODE shows desktop as expected in the Terminal, R Console and Python Console.

Steps to reproduce the issue:

  1. echo $POSITRON_MODE in a Terminal in Positron Web
  2. See the output desktop, but it should be server

Expected or desired behavior:

echo $POSITRON_MODE in a Terminal in Positron Web should return server

Were there any error messages in the UI, Output panel, or Developer Tools console?

No

juliasilge commented 1 month ago

Here is where we intend to set that env var:

https://github.com/posit-dev/positron/blob/675b180e2ec25781121c268a6bff162ac9e27857/src/vs/platform/terminal/node/terminalEnvironment.ts#L151

sharon-wang commented 1 month ago

I think we'll need to fix this for the 2024.11.0 release in order for https://github.com/posit-dev/positron/issues/4941 to work, as it relies on POSITRON_MODE showing the correct value to enable the supervisor on Workbench. (although the super sets POSITRON_MODE by checking the UIKind which should work...)

For some reason, this isn't an issue in Positron Server Web, but when running Positron 2024.11.0-140 in Workbench 2024.11.0-daily+338.pro1, the Kallichore Terminal doesn't show when kallichoreSupervisor.showTerminal is enabled.

sharon-wang commented 1 month ago

Hmm, I think this was a false alarm. I'm going to play around a bit more, but this might be because the Show Terminal setting doesn't take unless a completely new session in Workbench is created.

sharon-wang commented 1 month ago

Okay, so for kallichoreSupervisor.showTerminal to take, a user needs to enable it in one Positron session in Workbench and then create a new Positron session. The new Positron session will have the setting enabled and the terminal visible.

False alarm confirmed 👍

jmcphers commented 1 month ago

Yes, unfortunately you can't change hideFromUser once the terminal is created. :-/