microsoft / vscode

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

Built-in terminal is messing up with cursor position #214881

Closed jpenna closed 4 months ago

jpenna commented 4 months ago

Type: Bug

  1. Open built-in terminal
  2. Write a long command line
  3. See the cursor can't return to the first position, line breaks don't happen, commands show up in the middle of the other...

VS Code version: Code 1.90.0 (89de5a8d4d6205e5b11647eb6a74844ca23d2573, 2024-06-04T19:43:07.605Z) OS version: Linux x64 6.5.0-35-generic Modes:

System Info |Item|Value| |---|---| |CPUs|12th Gen Intel(R) Core(TM) i7-12700K (20 x 3480)| |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
skia_graphite: disabled_off
video_decode: enabled
video_encode: disabled_software
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off| |Load (avg)|1, 1, 1| |Memory (System)|31.13GB (19.92GB free)| |Process Argv|--crash-reporter-id 1f202001-3e86-40d8-9722-c0a65ff5d23b| |Screen Reader|no| |VM|0%| |DESKTOP_SESSION|ubuntu| |XDG_CURRENT_DESKTOP|Unity| |XDG_SESSION_DESKTOP|ubuntu| |XDG_SESSION_TYPE|x11|
Extensions (71) Extension|Author (truncated)|Version ---|---|--- flutter-snippets|ale|3.0.0 svelte-intellisense|ard|0.7.1 astro-vscode|ast|2.10.2 search-crates-io|bel|1.2.1 biome|bio|2024.5.251958 vscode-tailwindcss|bra|0.10.5 vscode-toggle-quotes|Bri|0.3.6 ruff|cha|2024.26.0 path-intellisense|chr|2.9.0 regex|chr|0.4.0 gitignore|cod|0.9.0 dart-code|Dar|3.90.0 flutter|Dar|3.90.0 vscode-eslint|dba|2.4.4 docore-rust-pack|doc|1.0.2 es7-react-js-snippets|dsz|4.4.3 rust-syntax|dus|0.6.1 gitlens|eam|15.1.0 vscode-great-icons|emm|2.1.105 prettier-vscode|esb|10.4.0 bloc|Fel|6.6.6 ginfuru-vscode-jekyll-syntax|gin|0.1.1 copilot|Git|1.200.0 copilot-chat|Git|0.16.0 vscode-github-actions|git|0.26.3 vscode-graphql|Gra|0.11.0 vscode-graphql-syntax|Gra|1.3.6 todo-tree|Gru|0.0.226 svg|joc|1.5.3 solidity|Jua|0.0.174 vsc-python-indent|Kev|1.18.0 wrapSelection|kon|0.10.0 flutter-intl|loc|1.19.3 mssql|ms-|1.22.1 sql-bindings-vscode|ms-|0.4.0 debugpy|ms-|2024.6.0 isort|ms-|2023.10.1 python|ms-|2024.8.0 vscode-pylance|ms-|2024.6.1 jupyter|ms-|2024.5.0 jupyter-keymap|ms-|1.1.2 jupyter-renderers|ms-|1.0.18 vscode-jupyter-cell-tags|ms-|0.1.9 vscode-jupyter-slideshow|ms-|0.1.6 cmake-tools|ms-|1.18.42 cpptools|ms-|1.20.5 cpptools-extension-pack|ms-|1.3.0 js-debug-nightly|ms-|2024.5.217 color-highlight|nau|2.8.0 autodocstring|njp|0.6.1 vscode-python-typehint|njq|1.5.1 indent-rainbow|ode|8.3.1 svelte-autoimport|piv|1.0.4 material-icon-theme|PKi|5.3.0 vscode-xml|red|0.27.1 rust-analyzer|rus|0.3.1995 crates|ser|0.6.6 shopify-liquid|sis|4.0.1 code-spell-checker|str|3.0.1 code-spell-checker-portuguese-brazilian|str|2.2.1 svelte-vscode|sve|108.5.0 even-better-toml|tam|0.19.2 vsfire|tob|1.4.1 cmake|twx|0.0.17 vscode-mdx|uni|1.8.8 errorlens|use|3.18.0 vscode-lldb|vad|1.10.0 vscode-apple-swift-format|vkn|1.4.3 markdown-all-in-one|yzh|3.6.2 material-theme|zhu|3.17.2 php-intellisense|zob|1.3.3 (3 theme extensions excluded)
A/B Experiments ``` vsliv368cf:30146710 vspor879:30202332 vspor708:30202333 vspor363:30204092 vscorecescf:30445987 vscod805:30301674 binariesv615:30325510 vsaa593:30376534 py29gd2263:31024239 c4g48928:30535728 azure-dev_surveyone:30548225 962ge761:30959799 pythongtdpath:30769146 welcomedialogc:30910334 pythonidxpt:30866567 pythonnoceb:30805159 asynctok:30898717 pythontestfixt:30902429 pythonregdiag2:30936856 pythonmypyd1:30879173 h48ei257:31000450 pythontbext0:30879054 accentitlementst:30995554 dsvsc016:30899300 dsvsc017:30899301 dsvsc018:30899302 cppperfnew:31000557 dsvsc020:30976470 pythonait:31006305 jchc7451:31067544 showvideot:31016892 chatpanelc:31048052 dsvsc021:30996838 g316j359:31013175 pythoncenvpt:31062603 a69g1124:31058053 dvdeprecation:31068756 pythonprt:31056678 dwnewjupytercf:31046870 26j00206:31048877 ```

This is the latest version: Screencast from 11-06-2024 10:56:22.webm

This is Insiders (see the cursor can't return the 0 position): Screencast from 11-06-2024 11:03:25.webm

meganrogge commented 4 months ago

I cannot reproduce, what shell are you using?

jpenna commented 4 months ago

Realized this isn't related to VSCode, it is actually happening in the OS shell as well. Sorry!

I don't know why, but showing the timestamp before the prompt line is messing up with the shell UI... I have it as the following and removing the \e[100m\T\e[0m part solves the issue.

 PS1='${debian_chroot:+($debian_chroot)}\e[100m\T\e[0m \[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[01;31m\]$(parse_git_branch)\[\033[00m\]\$ '

Sorry for opening an unrelated ticket!