Skip to content

Shift+Enter on multi-line statements sends whole statement in python terminal, but not in interactive window #15822

Open

Description

Environment data

  • VS Code version: 1.91.0
  • Jupyter Extension version (available under the Extensions sidebar): v2024.6.0
  • Python Extension version (available under the Extensions sidebar): v2024.8.1
  • OS (Windows | Mac | Linux distro) and version: debian 12
  • Python and/or Anaconda version: conda 23.7.3
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): conda
  • Jupyter server running: Local

Steps to reproduce:

  1. Add this setting to your user's JSON:
"interactiveWindow.executeWithShiftEnter": true
  1. Create a new python file.
  2. Write a multi-line statement, such as this:
def some_fun():
    a = 1
    return a
  1. Click one the first line (with def) and press Shift+Enter.

Expected behaviour

Should send the whole function definition to the interactive window, like it is now doing with the regular python terminal after the latest 1.91.0 updates.

Actual behaviour

Sends only the first line, which is not a valid python statement without the lines that follow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

feature-requestRequest for new features or functionalityinteractive-windowImpacts interactive window

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions