Skip to content

Cursor rendering issue in Python Interpreter started with latest VS code version, 1.86.0 #22866

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

Closed
julianghadially opened this issue Feb 6, 2024 · 9 comments
Assignees
Labels
area-terminal bug Issue identified by VS Code Team member as probable bug info-needed Issue requires more information from poster

Comments

@julianghadially
Copy link

julianghadially commented Feb 6, 2024

Type: Bug

Behaviour

Expected vs. Actual

I'm experiencing a very disruptive cursor rendering issue in python interpreter, when I updated to the latest vs code 1.86.0. The cursor in the python interpreter gets stuck on code lines that span multiple lines: When tracking to the left, the rendering gets stuck and edits at a different location than displayed. Vs Expected: you should be able to scroll to the left and have the cursor not get stuck.

I reverted VS Code and python extension to older versions, and the issue was still present.

System information: VS code version 1.86.0 and 1.85.2 (tried fixing across multiple versions)
Python version: 2024.0.0 and 2025.25.10292213.vsix

Steps to reproduce:

  1. Step 1: Update to VS code 1.86.0
  2. Step 2: paste a multi-line command into the terminal
Screen Shot 2024-02-06 at 3 15 40 PM
  1. Step 3: use the left arrow to navigate left until you reach the prior line. The rendered cursor stopped before reaching the prior lines, despite how many times I press left. I pressed the left arrow key ~10-11 times.
Screen Shot 2024-02-06 at 3 15 50 PM
  1. Step 4: Try pressing backspace, and the actual cursor was editing a place 10-11 characters to the left of where the cursor was stuck. (i.e., the i from simple was deleted instead of the t from prompt:
Screen Shot 2024-02-06 at 3 18 14 PM

After this error, if you press the down arrow, the cursor rendering is way off in random places, and it gets really wacky (e.g., cursors in the middle of the screen, etc.
Screen Shot 2024-02-06 at 3 24 30 PM

The problem does not occur when I start python from the terminal.

Ultimately, I need a way to send multi-line blocks to the terminal line-by-line (e.g., using shift-enter). This is a critical efficiency need that dictates which ide I use. There weren't any problems until the most recent updates to 1.86.0

Note: I tried many options like disabling GPU acceleartion, hardware acceleration, and anything i could find from searching for this issue.

Diagnostic data

  • Python version (& distribution if applicable, e.g. Anaconda): 3.8.18
  • Type of virtual environment used (e.g. conda, venv, virtualenv, etc.): Venv
  • Value of the python.languageServer setting: Default
Output for Python in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python)

XXX

User Settings


languageServer: "Pylance"

Extension version: 2023.25.10292213
VS Code version: Code 1.85.2 (8b3775030ed1a69b13e4f4c628c612102e30a681, 2024-01-18T06:40:32.531Z)
OS version: Darwin x64 21.6.0
Modes:

System Info
Item Value
CPUs Intel(R) Core(TM) i7-4870HQ CPU @ 2.50GHz (8 x 2500)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: disabled_off
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
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
Load (avg) 1, 2, 2
Memory (System) 16.00GB (0.04GB free)
Process Argv --crash-reporter-id 176f9fb8-6147-483c-8438-c8dec2a25aa9
Screen Reader no
VM 0%
A/B Experiments
vsliv368:30146709
vspor879:30202332
vspor708:30202333
vspor363:30204092
vscod805cf:30301675
binariesv615:30325510
vsaa593:30376534
py29gd2263:30899288
vscaat:30438848
c4g48928:30535728
azure-dev_surveyone:30548225
2i9eh265:30646982
962ge761:30951796
pythongtdpath:30769146
welcomedialogc:30910334
pythonidxpt:30866567
pythonnoceb:30805159
asynctok:30898717
pythontestfixt:30902429
pythonregdiag2:30936856
pyreplss1:30897532
pythonmypyd1:30879173
pythoncet0:30885854
pythontbext0:30879054
accentitlementsc:30887149
dsvsc016:30899300
dsvsc017:30899301
dsvsc018:30899302
dsvsc019bcf:30953938
3ef8e399:30949928
bg6jg535:30958357

@github-actions github-actions bot added the triage-needed Needs assignment to the proper sub-team label Feb 6, 2024
@anthonykim1
Copy link

Hello, @julianghadially thank you for filing this issue. So are you saying you are not able to go back to previous line of 'multi-line' command written in REPL? If that's the case, I'm not sure if I can repro that (See attached)

As far as " I need a way to send multi-line blocks to the terminal line-by-line (e.g., using shift-enter). "
You may explicitly highlight/select part/line of the multi-line block that you wish to learn and shift+enter to only send those highlighted/selected parts to the REPL.

Screen.Recording.2024-02-09.at.2.51.17.PM.mov

@github-actions github-actions bot added the info-needed Issue requires more information from poster label Feb 9, 2024
@julianghadially
Copy link
Author

Looking at your video, you've replicated the exact situation, but with my environment, the rendered cursor stops when it reaches the leftmost part of the line, but the true cursor continues. So from then on the edit location displayed to me is not actually the true edit location.

Is there any other information you need to resolve this?

@github-actions github-actions bot removed the info-needed Issue requires more information from poster label Feb 23, 2024
@BharatRaviIyengar
Copy link

BharatRaviIyengar commented May 31, 2024

I also have the same problem. When I type a long line in REPL the cursor moves to first position in the screen (even before the shell prompt) and overwrites the existing line. Of course this is only a visual rendering issue and the actual command works fine.

image

image

@adunmore
Copy link

I am experiencing something similar. However, it happens every time I launch a terminal with "Python: Run Selection/Line in Python Terminal". The cursor displays 47 characters ahead of the position I'm editing. It's very disruptive.

Solutions I've tried:

  • disabling python extension shell integration
  • switching terminals (happens on both bash and zsh)
  • disabling integrated terminal gpu acceleraction
  • toggling many other unrelated settings in the Python extension

Image

@adunmore
Copy link

I just did some testing. This issue appears to start with version 2024.0.0 of the extension. That's the first version where it happens to me. It does not occur when I'm using version 2023.22.1.

@anthonykim1
Copy link

I am experiencing something similar. However, it happens every time I launch a terminal with "Python: Run Selection/Line in Python Terminal". The cursor displays 47 characters ahead of the position I'm editing. It's very disruptive.

This should be fixed now. Its coming from cpythn3.13 python/cpython#126131

@github-actions github-actions bot added the info-needed Issue requires more information from poster label Dec 9, 2024
@anthonykim1
Copy link

@julianghadially are you still suffering from this on the latest insider version of VS Code?

@anthonykim1 anthonykim1 added bug Issue identified by VS Code Team member as probable bug area-terminal and removed triage-needed Needs assignment to the proper sub-team labels Dec 9, 2024
@anthonykim1
Copy link

Also wondering if its people are able to repro outside of Python REPL in terminal. Do typing other long commands in VS Code terminal repro the problem?

@adunmore
Copy link

I am experiencing something similar. However, it happens every time I launch a terminal with "Python: Run Selection/Line in Python Terminal". The cursor displays 47 characters ahead of the position I'm editing. It's very disruptive.

This should be fixed now. Its coming from cpythn3.13 python/cpython#126131

Yes it's fixed now. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-terminal bug Issue identified by VS Code Team member as probable bug info-needed Issue requires more information from poster
Projects
None yet
Development

No branches or pull requests

4 participants