microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
163.6k stars 29.03k forks source link

Terminal Issue - ANSI escape characters visible in terminal output #215966

Closed DanielMOliveira closed 4 months ago

DanielMOliveira commented 4 months ago

Type: Bug

Steps to Reproduce:

  1. Open VSCode PowerShell terminal.
  2. Observe the appearance of raw ANSI escape codes in the output.

Expected Behavior: The terminal should interpret ANSI codes for color and formatting, not display them as part of the output.

Actual Behavior: ANSI escape codes are visible in the terminal output, making it difficult to read. (\x1b7 \x1b[38\x3b2\x3b224\x3b222\x3b244min \x1b[38\x3b2\x3b75\x3b149\x3b233m\x1b[1mpwsh\x1b[22m\x1b[27m\x1b[38\x3b2\x3b224\x3b222\x3b244m \x1b[0m\x1b[38\x3b2\x3b224\x3b222\x3b244mat \x1b[38\x3b2\x3b75\x3b149\x3b233m\x1b[1m17:12:56\x1b[22m\x1b[0m\x1b8)

eg: image

image image

VS Code version: Code 1.90.1 (611f9bfce64f25108829dd295f54a6894e87339d, 2024-06-11T21:01:24.262Z) OS version: Windows_NT x64 10.0.22635 Modes:

settings.json ```json { "python.pythonPath": "c:\\Users\\User01\\AppData\\Local\\Programs\\Python\\Python38\\python.exe", "python.defaultInterpreterPath": "C:\\Users\\User01\\AppData\\Local\\Programs\\Python\\Python38\\python.exe", "terminal.integrated.shell.windows": "C:\\Program Files\\PowerShell\\7\\pwsh.exe", "[html]": { "editor.defaultFormatter": "vscode.html-language-features" }, "files.associations": {}, "editor.renderControlCharacters": true, "editor.formatOnPaste": true, "[sql]": { "editor.defaultFormatter": "ms-mssql.mssql" }, "team.showFarewellMessage": false, "azure.tenant": "", "workbench.editorAssociations": { "*.ipynb": "jupyter-notebook" }, "notebook.cellToolbarLocation": { "default": "right", "jupyter-notebook": "left" }, "security.workspace.trust.untrustedFiles": "open", "notebook.lineNumbers": "on", "sqltools.useNodeRuntime": true, "[xml]": { "editor.defaultFormatter": "redhat.vscode-xml" }, "team.showWelcomeMessage": false, "sqltools.connections": [], "git.enableSmartCommit": true, "git.autofetch": true, "jupyter.askForKernelRestart": false, "git.confirmSync": false, "python.languageServer": "Pylance", "settingsSync.ignoredExtensions": [ "aaron-bond.better-comments", "rbbit.typescript-hero" ], "editor.multiCursorModifier": "ctrlCmd", "[json]": { "editor.defaultFormatter": "vscode.json-language-features" }, "editor.fontLigatures": true, "workbench.editor.highlightModifiedTabs": true, "files.insertFinalNewline": true, "files.trimFinalNewlines": true, "workbench.iconTheme": "vscode-icons", "editor.wordSeparators": "`~!@#$%^&*()=+[{]}\\|;:'\",.<>/?", "editor.renderWhitespace": "all", "extensions.autoUpdate": "onlySelectedExtensions", "extensions.autoCheckUpdates": false, "window.title": "${dirty}${folderName}${separator}${activeEditorShort}${separator}${appName}", "editor.accessibilitySupport": "off", "[jsonc]": { "editor.defaultFormatter": "vscode.json-language-features" }, "csharp.suppressBuildAssetsNotification": true, "editor.multiCursorLimit": 20000, "[python]": { "editor.formatOnType": true }, "editor.inlineSuggest.enabled": true, "github.copilot.enable": { "*": true, "yaml": true, "plaintext": false, "markdown": true }, "python.formatting.provider": "yapf", "[xslt]": { "editor.semanticHighlighting.enabled": true }, "xml.symbols.maxItemsComputed": 50000, "genieai.openai.model": "gpt-4", "genieai.openai.temperature": 0.5, "genieai.openai.maxTokens": 2048, "gitlens.defaultDateShortFormat": "DD/MM/YYYY", "markdown-mermaid.darkModeTheme": "base", "[javascript]": { "editor.defaultFormatter": "vscode.typescript-language-features" }, "diffEditor.ignoreTrimWhitespace": false, "workbench.editor.empty.hint": "hidden", "cloudcode.duetAI.project": "root-territory-387117", "git.openRepositoryInParentFolders": "always", "terminal.integrated.defaultProfile.linux": "zsh", "debug.allowBreakpointsEverywhere": true, "remote.tunnels.alwaysUpdateCLI": true, "azureFunctions.projectRuntime": "~4", "remote.autoForwardPortsSource": "hybrid", "editor.stickyScroll.enabled": false, "dotnet.preferCSharpExtension": true, "omnisharp.useModernNet": false, "dotnet.automaticallyCreateSolutionInWorkspace": false, "remote.SSH.remotePlatform": { "raspberrypi.local": "linux" }, "terminal.integrated.cursorBlinking": true, "terminal.integrated.fontSize": 13, "terminal.integrated.profiles.windows": { "Command Prompt": { "path": [ "${env:windir}\\Sysnative\\cmd.exe", "${env:windir}\\System32\\cmd.exe" ], "args": [], "icon": "terminal-cmd" }, "Git Bash": { "source": "Git Bash" } }, "terminal.integrated.fontFamily": "Hack Nerd Font Propo", "terminal.integrated.suggest.enabled": true, "terminal.integrated.gpuAcceleration": "auto", "workbench.colorTheme": "Visual Studio 2017 Dark - C++", "terminal.integrated.copyOnSelection": true, "terminal.integrated.ignoreProcessNames": [ "oh-my-posh", "bash", "zsh" ] } ```
terminal log (code --log trace) [terminal.log.txt](https://github.com/user-attachments/files/15873896/terminal.log.txt)
System Info |Item|Value| |---|---| |CPUs|11th Gen Intel(R) Core(TM) i7-1185G7 @ 3.00GHz (8 x 1805)| |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| |Load (avg)|undefined| |Memory (System)|31.39GB (15.29GB free)| |Process Argv|--log trace --crash-reporter-id 9d000547-95fe-46be-96b3-4c24059fb364| |Screen Reader|no| |VM|0%|
Extensions (106) Extension|Author (truncated)|Version ---|---|--- angular-material|1to|0.13.0 better-comments|aar|3.0.2 vscode-angular2-files|ale|1.6.4 batch-replacer|ang|1.2.1 ng-template|Ang|17.1.0 vscode-django|bat|1.15.0 armview|ben|0.4.6 markdown-mermaid|bie|1.23.0 path-intellisense|chr|2.9.0 gitignore|cod|0.9.0 angular-schematics|cyr|6.9.0 xslt-xpath|del|1.5.15 python-environment-manager|don|1.2.4 python-extension-pack|don|1.7.0 xml|Dot|2.5.1 gitlens|eam|15.1.0 EditorConfig|Edi|0.16.4 auto-close-tag|for|0.5.15 auto-rename-tag|for|0.1.10 docker-explorer|for|0.1.7 docker-extension-pack|for|0.0.1 dotnet-test-explorer|for|0.7.8 pythonsnippets|frh|1.0.2 copilot|Git|1.203.0 copilot-chat|Git|0.16.1 vscode-github-actions|git|0.26.3 vscode-pull-request-github|Git|0.90.0 terraform|has|2.30.2 rest-client|hum|0.25.1 vscode-ansi|ili|1.1.7 angular2-switcher|inf|0.4.0 Ionide-fsharp|Ion|7.17.0 angular-file-changer|joh|0.0.4 Angular2|joh|16.0.1 vsc-python-indent|Kev|1.18.0 angular-extension-pack|loi|1.1.0 git-graph|mhu|1.30.0 azure-pipelines|ms-|1.228.0 azure-dev|ms-|0.8.3 vscode-apimanagement|ms-|1.0.8 vscode-azureappservice|ms-|0.25.2 vscode-azurecontainerapps|ms-|0.7.0 vscode-azurefunctions|ms-|1.15.0 vscode-azureresourcegroups|ms-|0.9.1 vscode-azurestaticwebapps|ms-|0.12.2 vscode-azurestorage|ms-|0.15.3 vscode-azureterraform|ms-|0.3.2 vscode-azurevirtualmachines|ms-|0.6.5 vscode-bicep|ms-|0.28.1 vscode-cosmosdb|ms-|0.22.0 vscode-docker|ms-|1.29.1 blazorwasm-companion|ms-|1.1.4 csdevkit|ms-|1.7.27 csharp|ms-|2.33.17 dotnet-interactive-vscode|ms-|1.0.5229040 vscode-dotnet-pack|ms-|1.0.13 vscode-dotnet-runtime|ms-|2.0.6 vscode-kubernetes-tools|ms-|1.3.16 data-workspace-vscode|ms-|0.5.0 mssql|ms-|1.22.1 sql-bindings-vscode|ms-|0.4.0 sql-database-projects-vscode|ms-|1.4.1 vscode-postgresql|ms-|0.3.0 autopep8|ms-|2024.0.0 debugpy|ms-|2024.6.0 python|ms-|2024.9.11691012 vscode-pylance|ms-|2024.6.1 sarif-viewer|MS-|3.4.4 jupyter|ms-|2024.5.0 jupyter-keymap|ms-|1.1.2 jupyter-renderers|ms-|1.0.17 vscode-jupyter-cell-tags|ms-|0.1.9 vscode-jupyter-slideshow|ms-|0.1.6 remote-ssh|ms-|0.112.0 remote-ssh-edit|ms-|0.86.0 remote-wsl|ms-|0.88.2 vscode-remote-extensionpack|ms-|0.25.0 azure-account|ms-|0.12.0 azurecli|ms-|0.6.0 cpptools|ms-|1.20.5 cpptools-extension-pack|ms-|1.3.0 powershell|ms-|2024.2.2 remote-explorer|ms-|0.4.3 remote-server|ms-|1.5.2 test-adapter-converter|ms-|0.1.9 vscode-node-azure-pack|ms-|1.2.0 vscode-speech|ms-|0.8.0 azurerm-vscode-tools|msa|0.15.11 autodocstring|njp|0.6.1 arrr|obe|0.1.3 docthis|oou|0.8.2 material-icon-theme|PKi|5.4.2 quicktype|qui|23.0.170 karma-problem-matcher|rct|1.0.1 vscode-xml|red|0.27.1 vscode-yaml|red|1.15.0 schema-explorer|Roh|0.5.1 angular-cli|seg|0.0.19 simontest|Sim|1.9.10 prophet|Sqr|1.4.40 move-ts|str|1.12.0 azure-event-hub-explorer|Sum|0.1.1 intellicode-api-usage-examples|Vis|0.2.8 vscodeintellicode|Vis|1.3.1 vscode-icons|vsc|12.8.0 jinja|who|0.0.8 (2 theme extensions excluded)
A/B Experiments ``` vsliv368:30146709 vspor879:30202332 vspor708:30202333 vspor363:30204092 vstes627:30244334 vscorecescf:30445987 vscod805cf:30301675 binariesv615:30325510 vsaa593:30376534 py29gd2263:31024239 vscaac:30438847 c4g48928:30535728 azure-dev_surveyone:30548225 962ge761:30959799 pythongtdpath:30769146 welcomedialog:30910333 pythonidxpt:30866567 pythonnoceb:30805159 asynctok:30898717 pythontestfixt:30902429 pythonregdiag2:30936856 pythonmypyd1:30879173 h48ei257:31000450 pythontbext0:30879054 accentitlementsc:30995553 dsvsc016:30899300 dsvsc017:30899301 dsvsc018:30899302 cppperfnew:31000557 dsvsc020:30976470 pythonait:31006305 jchc7451:31067544 chatpanelc:31048052 dsvsc021:30996838 01bff139:31013167 pythoncenvpt:31062603 a69g1124:31058053 dvdeprecation:31068756 pythonprt:31056678 dwnewjupyter:31046869 ```
meganrogge commented 4 months ago

This is already fixed in the Insiders build.

/duplicate https://github.com/microsoft/vscode/issues/211922