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

Terminal escape sequences shown when running code #24780

Open
MaxPowerWasTaken opened this issue Sep 30, 2024 · 11 comments
Open

Terminal escape sequences shown when running code #24780

MaxPowerWasTaken opened this issue Sep 30, 2024 · 11 comments
Assignees
Labels
area-terminal bug Issue identified by VS Code Team member as probable bug triage-needed Needs assignment to the proper sub-team

Comments

@MaxPowerWasTaken
Copy link

Type: Bug

I have the following code in my main.py:

import pymupdf

print(f"pymupdf version is: {pymupdf.__version__}")

I can create a python3.12 environment with pymupdf installed and run it from my (kubuntu24.04) shell without issues, with the following commands (showing shell log after each >command):

>uv --version
uv 0.4.17

>uv init --no-pin-python
Initialized project `askliz2`

>uv venv --python 3.12.6 
Using CPython 3.12.6
Creating virtual environment at: .venv
Activate with: source .venv/bin/activate

>source .venv/bin/activate 
askliz2>uv add pymupdf 
Resolved 3 packages in 281ms
Installed 2 packages in 11ms
 + pymupdf==1.24.10
 + pymupdfb==1.24.10

askliz2>python main.py
pymupdf version is: 1.24.10

However, when I launch vscode from this folder with my uv venv activated with code ., and then highlight the line import pymupdf and hit shift+enter to run it in the integrated terminal, I get the following vscode integrated terminal output:

/home/max/askliz2/.venv/bin/python 
Python 3.12.6 (main, Sep  9 2024, 22:11:19) [Clang 18.1.8 ] on linux
Type "help", "copyright", "credits" or "license" for more information.
]633;E;exit()]633;D;0]633;A>>> ]633;B]633;Cimport pymupdf
]633;E;import pymupdf]633;D;0]633;A>>> ]633;B]633;C

Things I've tried so far:

  • upgrading uv version
  • hosing and re-installing vscode
  • installing different python versions (e.g. 3.12.0, 3.12.6, 3.9)
  • right-clicking to clear terminal and kill terminal and then trying again

When I use the command pallet to select python interpreter, it shows me it's trying to use Python 3.12.6('.venv') ./.venv/bin/python, as it should be, and as the vscode integrated logs above already indicate.

VS Code version: Code 1.93.1 (38c31bc77e0dd6ae88a4e9cc93428cc27a56ba40, 2024-09-11T17:20:05.685Z)
OS version: Linux x64 6.10.6-061006-generic
Modes:

System Info
Item Value
CPUs Intel(R) Core(TM) i5-10210U CPU @ 1.60GHz (8 x 2800)
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: disabled_software
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off
webnn: disabled_off
Load (avg) 3, 3, 2
Memory (System) 15.41GB (9.05GB free)
Process Argv . --crash-reporter-id 278e8daa-3421-43f0-a591-500f30110725
Screen Reader no
VM 0%
DESKTOP_SESSION plasma
XDG_CURRENT_DESKTOP KDE
XDG_SESSION_DESKTOP KDE
XDG_SESSION_TYPE x11
Extensions (26)
Extension Author (truncated) Version
aws-toolkit-vscode ama 3.26.0
markdown-checkbox bie 0.4.0
markdown-mermaid bie 1.25.0
minizinc Dek 0.1.1
copilot Git 1.234.1129
copilot-chat Git 0.21.2024090602
language-julia jul 1.124.2
json-lines-viewer leh 0.0.4
vscode-docker ms- 1.29.3
debugpy ms- 2024.10.0
isort ms- 2023.10.1
python ms- 2024.14.1
vscode-pylance ms- 2024.9.2
jupyter ms- 2024.8.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
remote-containers ms- 0.384.0
remote-ssh ms- 0.114.3
remote-ssh-edit ms- 0.86.0
remote-explorer ms- 0.4.3
vsliveshare ms- 1.0.5941
vsliveshare-pack ms- 0.4.0
diagramspreviewer teh 1.0.9
json Zai 2.0.2
A/B Experiments
vsliv368cf:30146710
vspor879:30202332
vspor708:30202333
vspor363:30204092
vscod805:30301674
binariesv615:30325510
vsaa593:30376534
py29gd2263:31024239
c4g48928:30535728
azure-dev_surveyone:30548225
a9j8j154:30646983
962ge761:30959799
pythongtdpath:30769146
welcomedialog:30910333
pythonnoceb:30805159
asynctok:30898717
pythonmypyd1:30879173
2e7ec940:31000449
pythontbext0:30879054
accentitlementsc:30995553
dsvsc016:30899300
dsvsc017:30899301
dsvsc018:30899302
cppperfnew:31000557
dsvsc020:30976470
pythonait:31006305
dsvsc021:30996838
01bff139:31013167
a69g1124:31058053
dvdeprecation:31068756
dwnewjupyter:31046869
2f103344:31071589
impr_priority:31102340
nativerepl1:31139838
refactort:31108082
pythonrstrctxt:31112756
flighttreat:31134774
wkspc-onlycs-t:31132770
nativeloc1:31134641
wkspc-ranged-c:31125598
cf971741:31144450
autoexpandse:31146404
iacca2:31144504
cc771715:31146322

@vs-code-engineering vs-code-engineering bot added the triage-needed Needs assignment to the proper sub-team label Sep 30, 2024
@chrmarti chrmarti transferred this issue from microsoft/vscode Sep 30, 2024
@chrmarti chrmarti removed their assignment Sep 30, 2024
@chrmarti chrmarti removed the triage-needed Needs assignment to the proper sub-team label Sep 30, 2024
@github-actions github-actions bot added the triage-needed Needs assignment to the proper sub-team label Sep 30, 2024
@karthiknadig karthiknadig self-assigned this Sep 30, 2024
@karthiknadig
Copy link
Member

@Tyriar This looks like a terminal bug.

@MaxPowerWasTaken
Copy link
Author

hey, sorry to be persistent, but any idea how I might fix or get around this? I'd really love to use vscode with uv...

@MaxPowerWasTaken
Copy link
Author

hello @karthiknadig or @Tyriar , any ideas on how I might resolve this? Just tried again on a fresh repo with a fresh install of vscode last night after a month, still hitting the same issue though.

@karthiknadig
Copy link
Member

@MaxPowerWasTaken Try toggling this setting as a potential workaround. You will have to re-open the terminal:
Image

@github-actions github-actions bot added the info-needed Issue requires more information from poster label Nov 4, 2024
@MaxPowerWasTaken
Copy link
Author

thanks for the suggestion @karthiknadig . I toggled that setting from checked to unchecked, then restarted vscode but still am having the same problem.

this time higlighted and hit shift+enter on the following two lines:

def main():
    print("Hello from hello.py!")

and observed the following in my integrated terminal:

 ~/uv/askliz_frontend  main ?6  /home/max/uv_test/askliz_frontend/.venv/bin/python
Python 3.12.6 (main, Sep  9 2024, 22:11:19) [Clang 18.1.8 ] on linux
Type "help", "copyright", "credits" or "license" for more information.
]633;E;exit()]633;D;0]633;A>>> ]633;B]633;Cdef main():
...     print("Hello from hello.py!")
... 
]633;E;    print("Hello from hello.py!")]633;D;0]633;A>>> ]633;B]633;C

@github-actions github-actions bot removed the info-needed Issue requires more information from poster label Nov 4, 2024
@nuzar
Copy link

nuzar commented Dec 4, 2024

Turn off python.terminal.shellIntegration.enabled doesn't work.

@karthiknadig karthiknadig changed the title vscode trying but failing to use my uv venv Terminal escape sequences shown when running code Dec 10, 2024
@karthiknadig karthiknadig assigned Tyriar and unassigned karthiknadig Dec 10, 2024
@karthiknadig karthiknadig removed the triage-needed Needs assignment to the proper sub-team label Dec 10, 2024
@karthiknadig karthiknadig transferred this issue from microsoft/vscode-python Dec 10, 2024
Copy link

Thanks for creating this issue! It looks like you may be using an old version of VS Code, the latest stable release is 1.95.3. Please try upgrading to the latest version and checking whether this issue remains.

Happy Coding!

@Tyriar Tyriar assigned anthonykim1 and unassigned Tyriar Dec 18, 2024
@Tyriar
Copy link
Member

Tyriar commented Dec 18, 2024

This is definitely related to the python shell integration script. I don't think this happens anymore though as it's disabled in Windows for now.

@Tyriar Tyriar closed this as completed Dec 18, 2024
@MaxPowerWasTaken
Copy link
Author

Hi @Tyriar, I observed this issue on my ubuntu24.04 laptop (not linux as in windows/wsl). Should it still be closed already, even if it should be resolved on windows machines?

@Tyriar
Copy link
Member

Tyriar commented Dec 19, 2024

@MaxPowerWasTaken thanks for the clarification, I missed that. Reopening for @anthonykim1 to consider.

@Tyriar Tyriar reopened this Dec 19, 2024
@anthonykim1
Copy link

Can @MaxPowerWasTaken @nuzar update the Python extension to lastest and make sure you turned off setting for
python.terminal.shellIntegration.enabled so that it is false? (make sure you disable both user and workspace).

Make sure to reload as these changes wont be in effect until you reload after change this setting.

@anthonykim1 anthonykim1 transferred this issue from microsoft/vscode Feb 3, 2025
@anthonykim1 anthonykim1 added bug Issue identified by VS Code Team member as probable bug area-terminal labels Feb 3, 2025
@github-actions github-actions bot added the triage-needed Needs assignment to the proper sub-team label Feb 3, 2025
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 triage-needed Needs assignment to the proper sub-team
Projects
None yet
Development

No branches or pull requests

6 participants