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

Code render glitch when navigating history in Terminal #226988

Closed
MCarzolio2 opened this issue Aug 26, 2024 · 6 comments
Closed

Code render glitch when navigating history in Terminal #226988

MCarzolio2 opened this issue Aug 26, 2024 · 6 comments
Assignees
Labels
*duplicate Issue identified as a duplicate of another issue(s)

Comments

@MCarzolio2
Copy link

Type: Bug

Behaviour

Using arrows to navigate history in a Terminal breaks the code rendering. This happens in interactive Python that is launched using shift + enter on highlighted code.

I've noticed that this issue only happens if the $PYTHONSTARTUP variable is set to pythonrc.py. Unsetting this variable launches a well-behaved Python session.

Steps to reproduce:

  1. Send code to Terminal using shift + enter.
  2. Navigate to the Terminal.
  3. Press up arrow to navigate to previous command in history.
  4. Observe that code rendering has broken.

Diagnostic data

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

2024-08-26 12:06:00.971 [info] > /opt/homebrew/bin/python3 ~/.vscode/extensions/ms-python.python-2024.12.3-darwin-arm64/python_files/normalizeSelection.py
2024-08-26 12:06:01.132 [info] > pixi info --json
2024-08-26 12:06:01.132 [info] cwd: /
2024-08-26 12:06:01.168 [warning] failed to determine pixi project information for the interpreter at /opt/homebrew/bin/python3
2024-08-26 12:06:01.169 [info] Send text to terminal: /opt/homebrew/bin/python3
2024-08-26 12:06:01.264 [info] Send text to terminal: print("Hello world")  # First print "Hello world"

2024-08-26 12:06:03.583 [info] > /opt/homebrew/bin/python3 ~/.vscode/extensions/ms-python.python-2024.12.3-darwin-arm64/python_files/normalizeSelection.py
2024-08-26 12:06:03.627 [info] Send text to terminal: print("Goodbye world")  # Then print "Goodbye world"


Extension version: 2024.12.3
VS Code version: Code 1.92.2 (Universal) (fee1edb, 2024-08-14T17:29:30.058Z)
OS version: Darwin arm64 23.6.0
Modes:

  • Python version (& distribution if applicable, e.g. Anaconda): 3.12.5
  • Type of virtual environment used (e.g. conda, venv, virtualenv, etc.): Global
  • Value of the python.languageServer setting: Default
User Settings


languageServer: "Pylance"

experiments
• enabled: false

Installed Extensions
Extension Name Extension Id Version
Black Formatter ms-python.black-formatter 2024.2.0
GitHub Copilot GitHub.copilot 1.223.0
GitHub Copilot Chat GitHub.copilot-chat 0.18.2
JavaScript Debugger ms-vscode.js-debug 1.92.0
JavaScript Debugger Companion Extension ms-vscode.js-debug-companion 1.1.3
Jupyter ms-toolsai.jupyter 2024.7.0
Jupyter Cell Tags ms-toolsai.vscode-jupyter-cell-tags 0.1.9
Jupyter Keymap ms-toolsai.jupyter-keymap 1.1.2
Jupyter Notebook Renderers ms-toolsai.jupyter-renderers 1.0.19
Jupyter Slide Show ms-toolsai.vscode-jupyter-slideshow 0.1.6
LaTeX Workshop James-Yu.latex-workshop 10.1.0
Pylance ms-python.vscode-pylance 2024.8.1
Python ms-python.python 2024.12.3
Python Debugger ms-python.debugpy 2024.10.0
Table Visualizer for JavaScript Profiles ms-vscode.vscode-js-profile-table 1.0.9
System Info
Item Value
CPUs Apple M2 (8 x 2400)
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
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off
Load (avg) 2, 3, 3
Memory (System) 24.00GB (0.05GB free)
Process Argv --crash-reporter-id 043b3377-a518-47cc-bab5-dec640206c2f
Screen Reader no
VM 0%
A/B Experiments
vsliv368cf:30146710
vspor879:30202332
vspor708:30202333
vspor363:30204092
vscod805cf:30301675
binariesv615:30325510
vsaa593:30376534
py29gd2263:31024239
c4g48928:30535728
azure-dev_surveyonecf:30548226
962ge761:30959799
pythongtdpath:30769146
welcomedialogc:30910334
pythonnoceb:30805159
asynctok:30898717
pythonregdiag2:30936856
pythonmypyd1:30879173
h48ei257:31000450
pythontbext0:30879054
accentitlementsc:30995553
dsvsc016:30899300
dsvsc017:30899301
dsvsc018:30899302
cppperfnew:31000557
dsvsc020:30976470
pythonait:31006305
dsvsc021:30996838
01bff139:31013167
pythoncenvpt:31062603
a69g1124:31058053
dvdeprecation:31068756
dwnewjupytercf:31046870
2f103344:31071589
impr_priority:31102340
refactort:31108082
pythonrstrctxt:31112756
flighttreat:31119336
wkspc-onlycs-c:31111717
wkspc-ranged-c:31123312
ei213698:31121563

@MCarzolio2
Copy link
Author

Screen.Recording.2024-08-26.at.12.13.13.PM.mov

@MCarzolio2
Copy link
Author

image

@meganrogge
Copy link
Contributor

@Tyriar should we close this in favor of #226992?

@meganrogge meganrogge closed this as not planned Won't fix, can't repro, duplicate, stale Aug 28, 2024
@meganrogge meganrogge added the *duplicate Issue identified as a duplicate of another issue(s) label Aug 28, 2024
@Tyriar Tyriar reopened this Aug 28, 2024
@Tyriar Tyriar removed the *duplicate Issue identified as a duplicate of another issue(s) label Aug 28, 2024
@Tyriar
Copy link
Member

Tyriar commented Aug 28, 2024

I'm not sure what would have caused this, maybe upgrading to use executeCommand instead of sendText would fix the problem? That's tracked in microsoft/vscode-python#23929

@Tyriar Tyriar closed this as completed Aug 28, 2024
@Tyriar Tyriar added the *duplicate Issue identified as a duplicate of another issue(s) label Aug 28, 2024
@MCarzolio2
Copy link
Author

I'm not sure what would have caused this, maybe upgrading to use executeCommand instead of sendText would fix the problem? That's tracked in microsoft/vscode-python#23929

is there a way I can test this easily?

@Tyriar
Copy link
Member

Tyriar commented Aug 29, 2024

@MCarzolio2 this would need a change in the python extension. You could try make the change there but you'd need to set up development for the extension.

@vs-code-engineering vs-code-engineering bot locked and limited conversation to collaborators Oct 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*duplicate Issue identified as a duplicate of another issue(s)
Projects
None yet
Development

No branches or pull requests

5 participants
@Tyriar @MCarzolio2 @meganrogge @anthonykim1 and others