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

Run Selection in Terminal has been replaced by Run in REPL, losing functionality #24332

Open
adamrickayzenanvil opened this issue Oct 24, 2024 · 2 comments

Comments

@adamrickayzenanvil
Copy link

adamrickayzenanvil commented Oct 24, 2024

Type: Bug

Behaviour

Previously I have been able to run my code in the terminal in pieces, by highlighting bits of code and pressing Shift+Enter. This is really useful for error handling, testing and holding variables in an accessible memory. However, coworkers are now running into an issue where we cannot call Run Selection In Terminal, as this option appears to have been replaced by the Run Selection In REPL command. This is a much clunkier user interface, opening on the right side of the screen instead of the bottom which blocks vision of the code and makes it much harder to use. To add to this, the REPL doesn't recognise the current working directory, and this needs to be manually set which is a pain when someone is setting up multiple directories.

I have tried to remap the keybindings for Run Selection In Terminal but nothing happens when I press them; similarly I cannot remap the keybindings of Run Selection In REPL as they don't seem to exist. Any help reverting the changes back to what they used to be is really appreciated.

How it used to look:

Image
Image

How it now looks (notice how I need to set the working directory manually here as well or the code will not run):

Image
Image

If this is not a bug, could it please be made clearer for users how to change this option? I have looked everywhere I can think of.
Thanks!

Steps to reproduce:

Highlight code, right click, go to Python, the option is Run Selection In REPL and not Run Selection In Terminal.

VS Code version: Code 1.94.2 (384ff7382de624fb94dbaf6da11977bba1ecd427, 2024-10-09T16:08:44.566Z)
OS version: Windows_NT arm64 10.0.26100
Modes:

System Info
Item Value
CPUs Snapdragon(R) X Elite - X1E80100 - Qualcomm(R) Oryon(TM) CPU (12 x 2976)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off
Load (avg) undefined
Memory (System) 31.57GB (6.22GB free)
Process Argv --crash-reporter-id 7dae14f1-d211-45d0-a6cf-fce0019208a5
Screen Reader no
VM 0%
Extensions (9)
Extension Author (truncated) Version
debugpy ms- 2024.12.0
python ms- 2024.8.1
vscode-pylance ms- 2024.10.1
jupyter ms- 2024.9.1
jupyter-keymap ms- 1.1.2
jupyter-renderers ms- 1.0.19
vscode-jupyter-cell-tags ms- 0.1.9
vscode-jupyter-slideshow ms- 0.1.6
vscode-icons vsc 12.9.0
A/B Experiments
vsliv368cf:30146710
vspor879:30202332
vspor708:30202333
vspor363:30204092
vscod805cf:30301675
binariesv615:30325510
vsaa593:30376534
py29gd2263:31024239
c4g48928:30535728
azure-dev_surveyone:30548225
962ge761:30959799
pythongtdpath:30769146
pythonnoceb:30805159
asynctok:30898717
pythonmypyd1:30879173
2e7ec940:31000449
pythontbext0:30879054
cppperfnew:31000557
dsvsc020:30976470
pythonait:31006305
dsvsc021:30996838
0ee40948:31013168
dvdeprecation:31068756
dwnewjupytercf:31046870
impr_priority:31102340
nativerepl2:31139839
refactort:31108082
pythonrstrctxt:31112756
wkspc-onlycs-t:31132770
nativeloc2:31134642
wkspc-ranged-t:31151552
cf971741:31144450
autoexpandse:31146404
iacca2:31156134
notype1cf:31157160
5fd0e150:31155592
dwcopilot:31164048
iconenabled:31158251

@meganrogge meganrogge assigned anthonykim1 and unassigned meganrogge Oct 24, 2024
@anthonykim1 anthonykim1 transferred this issue from microsoft/vscode Oct 24, 2024
@github-actions github-actions bot added the triage-needed Needs assignment to the proper sub-team label Oct 24, 2024
@anthonykim1
Copy link

Hello @adamrickayzenanvil Thanks for filing this issue and thoroughly explaining this.

The new editor REPL that you see is called Native REPL (experimental feature) which you can turn it off via setting:
Image

With the new Native REPL you may also get features that should help you test/run your blocks of code with Intellisense, syntax highlighting, etc..
You may also drag this down to the bottom if you strongly prefer REPL being in the "usual" bottom location as well.
Image

As far as current directories go, we set it to the highest "workspace directory" and you should be seeing option to select your cwd if you have multiple VS Code workspace defined in your project. Reference: https://code.visualstudio.com/docs/editor/multi-root-workspaces

Would love to hear what you think and let me know how things go. Thanks

@github-actions github-actions bot added the info-needed Issue requires more information from poster label Oct 24, 2024
@anthonykim1 anthonykim1 added area-repl area-terminal and removed info-needed Issue requires more information from poster triage-needed Needs assignment to the proper sub-team labels Oct 24, 2024
@adamrickayzenanvil
Copy link
Author

Hi @anthonykim1. Many thanks for the advice, this fixed my issue.

My honest opinion (and that of my team) is that this is a very unclear and detrimental change. It was extremely difficult for me to find the solution to this, and it's really not ideal for our workflow to have changes like this made without it being clear how to reverse them. Running the code to the REPL is very similar to running it in an interactive window, so it is not clear to us why the running to terminal command (which provides different functionality) is superseded by the new REPL option. There may be some situations where someone would want to use the new command but I think it needs to be clearer to the user that they can change it if needed.

As a note, both me and a coworker had issues with the current working directory which felt like a bug. We are used to opening a workspace and having the cwd update automatically so you can run lines like 'from core.imports import *', but with the new REPL method the cwd was set to C:\Users\Name, which caused issues. After reverting the changes following your advice this issue disappeared so it definitely seemed linked to the REPL.

Many thanks!

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

No branches or pull requests

3 participants