Skip to content

Keybinds for Enter key in REPL and Interactive Windows not restricted to Python contexts #24923

Open
@esdmr

Description

@esdmr

Type: Bug

Behaviour

Non-Python REPL and Interactive Windows run the python keybindings for the Enter key (python.execInREPLEnter and python.execInInteractiveWindowEnter respectively). If the last python interpreter is not available anymore, the command would not be run and an error message claiming that “An Invalid Python interpreter is selected” would emerge. Since the current REPL or Interactive Window is not for Python, a Python interpreter should not be necessary.

Steps to reproduce:

  1. Open a non-Python REPL or Interactive Window (e.g. a Node.js REPL)
  2. Type something and press enter
  3. Python extension handles the enter key. If the last Python interpreter is not available, the command will not run, and an error message pops up:
    “An Invalid Python interpreter is selected, please try changing it to enable features such as IntelliSense, linting, and debugging. See output for more details regarding why the interpreter is invalid.”
  4. (Use either ctrl-enter or the execute button to bypass the python keybind)

Diagnostic data

Output for Python in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python)

2025-03-20 21:22:45.756 [warning] Failed to check if /path/to/last-python-project/.venv/bin/python3.12 is an executable [Error: ENOENT: no such file or directory, lstat '/path/to/last-python-project/.venv/bin/python3.12'] {
  errno: -2,
  code: 'ENOENT',
  syscall: 'lstat',
  path: '/path/to/last-python-project/.venv/bin/python3.12'
}
2025-03-20 21:22:45.760 [warning] Identifier for virt-virtualenv failed to identify /path/to/last-python-project/.venv/bin/python3.12 [Error: ENOENT: no such file or directory, scandir '/path/to/last-python-project/.venv/bin'] {
  errno: -2,
  code: 'ENOENT',
  syscall: 'scandir',
  path: '/path/to/last-python-project/.venv/bin'
}
2025-03-20 21:22:45.765 [warning] Failed to check if /path/to/last-python-project/.venv/bin/python3.12 is an executable [Error: ENOENT: no such file or directory, lstat '/path/to/last-python-project/.venv/bin/python3.12'] {
  errno: -2,
  code: 'ENOENT',
  syscall: 'lstat',
  path: '/path/to/last-python-project/.venv/bin/python3.12'
}
2025-03-20 21:22:45.767 [warning] Identifier for virt-virtualenv failed to identify /path/to/last-python-project/.venv/bin/python3.12 [Error: ENOENT: no such file or directory, scandir '/path/to/last-python-project/.venv/bin'] {
  errno: -2,
  code: 'ENOENT',
  syscall: 'scandir',
  path: '/path/to/last-python-project/.venv/bin'
}
2025-03-20 21:22:48.696 [warning] Failed to check if /path/to/last-python-project/.venv/bin/python3.12 is an executable [Error: ENOENT: no such file or directory, lstat '/path/to/last-python-project/.venv/bin/python3.12'] {
  errno: -2,
  code: 'ENOENT',
  syscall: 'lstat',
  path: '/path/to/last-python-project/.venv/bin/python3.12'
}
2025-03-20 21:22:48.700 [warning] Identifier for virt-virtualenv failed to identify /path/to/last-python-project/.venv/bin/python3.12 [Error: ENOENT: no such file or directory, scandir '/path/to/last-python-project/.venv/bin'] {
  errno: -2,
  code: 'ENOENT',
  syscall: 'scandir',
  path: '/path/to/last-python-project/.venv/bin'
}

Extension version: 2025.0.0
VS Code version: Code 1.95.1 (65edc4939843c90c34d61f4ce11704f09d3e5cb6, 2024-10-31T05:14:54.222Z)
OS version: Linux x64 5.15.0-134-generic
Modes:

Metadata

Metadata

Labels

area-replbugIssue identified by VS Code Team member as probable bug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions