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

Multi-Session : the wrong interpreter path can show in the status bar #6719

Open
jonvanausdeln opened this issue Mar 10, 2025 · 1 comment
Open
Assignees
Labels
area: console Issues related to Console category. area: core Issues related to Core category. bug Something isn't working theme: multisession console

Comments

@jonvanausdeln
Copy link
Contributor

jonvanausdeln commented Mar 10, 2025

System details:

Positron and OS details:

Positron Version: 2025.04.0 (system setup) build 64
Code - OSS Version: 1.96.0
Commit: b25e187
Date: 2025-03-10T02:46:12.724Z
Electron: 32.2.6
Chromium: 128.0.6613.186
Node.js: 20.18.1
V8: 12.8.374.38-electron.0
OS: Windows_NT x64 10.0.26100

Interpreter details:

Various Python

Describe the issue:

With the implementation of #3033, the interpreter path displayed by Python does not mirror the active console session anymore in Positron when the multiple console sessions feature is enabled.

The Python active interpreter and the Positron foreground session are meant to be kept in sync.

The $selectLanguageRuntime method that Positron make available to the extension host can be called by language packs to signal that Positron should change the active runtime - which means Positron needs to change the active session.

The active Python interpreter is what powers the LSP - so this needs to be fixed to allow diagnostics to work!

Steps to reproduce the issue:

  1. Enable experimental multi sessions.
  2. Open a python file
  3. Start a python console
  4. Start another python console with a different version

Expected or desired behavior:

For the versions to match

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

None

@jonvanausdeln jonvanausdeln added the bug Something isn't working label Mar 10, 2025
@juliasilge juliasilge added area: console Issues related to Console category. area: core Issues related to Core category. theme: multisession console labels Mar 10, 2025
@isabelizimm
Copy link
Contributor

The path in the console is what the Python extension believes to be the "Active Interpreter," which is used by the extension to power the LSP, decide if there is a UI treatment to terminals, etc.

@dhruvisompura dhruvisompura self-assigned this Mar 12, 2025
dhruvisompura added a commit that referenced this issue Mar 13, 2025
Addresses #6719 

This fixes a regression introduced to `$selectLanguageRuntime` when
multiple console sessions is enabled.

The `$selectLanguageRuntime` function exposed to the extension host by
Positron is meant to be used by a language pack to signal to Positron
that the interpreter/runtime has changed on their end and that Positron
should take appropriate action. Right now that means Positron should
change the foreground session to a session for that runtime.

The foreground session is not updated by Positron when
`$selectLanguageRuntime` is being called which is causing the user to
see mismatched information in the UI.

The fix is to update the foreground session in Positron when
`$selectLanguageRuntime` is called.

Note: This doesn't address the inverse path. When the foreground session
changes, the Python extension does not currently change the active
interpreter. That can be handled after
#6714 which provides a way for
extensions to be notified the foreground session has changed.

### Release Notes


#### New Features

- N/A

#### Bug Fixes

- N/A


### QA Notes

@:sessions @:console @:web

### Screenshots

https://github.com/user-attachments/assets/59b878a1-87e1-48d7-9307-b8a1ce7421e2
@juliasilge juliasilge added this to the 2025.04.0 Pre-Release milestone Mar 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: console Issues related to Console category. area: core Issues related to Core category. bug Something isn't working theme: multisession console
Projects
None yet
Development

No branches or pull requests

4 participants