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

when pasting in git bash terminal it adds 1~ at the end #141879

Closed
MV88 opened this issue Jan 31, 2022 · 5 comments
Closed

when pasting in git bash terminal it adds 1~ at the end #141879

MV88 opened this issue Jan 31, 2022 · 5 comments
Assignees
Labels
polish Cleanup and polish issue terminal-input Relating to typing in the terminal not doing the right thing, IMEs not working, etc. windows VS Code on Windows issues
Milestone

Comments

@MV88
Copy link

MV88 commented Jan 31, 2022

Issue Type: Bug

when pasting the sha of a commit from github into git bash terminal inside vs code
I end up having 1~

correct 812c47165c0c1ab5658af344f91178d93c261453
wrong 812c47165c0c1ab5658af344f91178d93c2614531~

if i paste a bit longer text i have this
correct b34e807456cfd2333889dc83f3a867dffaa6169cd
wrong b34e807456cfd2333889dc83f3a867dffaa6169cd01~

correct b34e807456cfd2333889dc83f3a867dffaa6169cd2
wrong b34e807456cfd2333889dc83f3a867dffaa6169cd2[201~

it happens only for the shell inside vs code,
if i open the gitbash outside, it works fine

i tried the following solution with no luck

https://unix.stackexchange.com/questions/196098/copy-paste-in-xfce4-terminal-adds-0-and-1

printf "\e[?2004l"

VS Code version: Code 1.63.2 (899d46d, 2021-12-15T09:40:02.816Z)
OS version: Windows_NT x64 10.0.19041
Restricted Mode: No

System Info
Item Value
CPUs 11th Gen Intel(R) Core(TM) i7-11700 @ 2.50GHz (16 x 2496)
GPU Status 2d_canvas: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
rasterization: enabled
skia_renderer: enabled_on
video_decode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
Load (avg) undefined
Memory (System) 15.80GB (7.27GB free)
Process Argv --folder-uri file:///c%3A/Work/projects/Geosolutions/Mapstore2 --crash-reporter-id 9267395e-ce81-4eec-aff5-590816b21859
Screen Reader no
VM 0%
Extensions (29)
Extension Author (truncated) Version
npm-intellisense chr 1.4.0
path-intellisense chr 2.7.0
vscode-eslint dba 2.2.2
EditorConfig Edi 0.16.4
code-runner for 0.11.6
path-autocomplete ion 1.18.0
vscode-peacock joh 4.0.0
restructuredtext lex 168.0.0
vs-code-quick-require mil 3.1.3
csharp ms- 1.24.0
python ms- 2021.12.1559732655
jupyter ms- 2021.11.1001550889
jupyter-keymap ms- 1.0.0
jupyter-renderers ms- 1.0.4
atom-keybindings ms- 3.0.9
vscode-extension-auto-import Nuc 1.4.3
react-proptypes-intellisense OfH 1.0.3
require-sort Per 0.0.1
vscode-xml red 0.18.2
code-settings-sync Sha 3.4.3
code-spell-checker str 2.1.4
simple-rst tro 1.5.1
errorlens use 3.4.1
vscodeintellicode Vis 1.2.16
vscode-java-debug vsc 0.38.0
vscode-java-dependency vsc 0.19.0
vscode-java-pack vsc 0.21.0
vscode-maven vsc 0.35.0
gitblame wad 8.1.0

(1 theme extensions excluded)

A/B Experiments
vsliv368cf:30146710
vsreu685:30147344
python383cf:30185419
vspor879:30202332
vspor708:30202333
vspor363:30204092
pythonvspyl392cf:30425750
pythontb:30283811
pythonvspyt551cf:30345471
pythonptprofiler:30281270
vshan820:30294714
vstes263:30335439
pythondataviewer:30285071
vscod805:30301674
pythonvspyt200:30340761
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
vsaa593:30376534
vsc1dsc:30428978
pythonvs932:30410667
vscop804cf:30404767
vscop453:30404998
vsrem710cf:30416617

@IllusionMH
Copy link
Contributor

IllusionMH commented Jan 31, 2022

May be another effect of git-for-windows/git#3657

Do you see same issue reproducible outside of VS Code? E.g. in Windows Terminal, ConEmu, or directly launching bash.exe (note that git-bash.exe doesn't have same problem).

@MV88
Copy link
Author

MV88 commented Jan 31, 2022

Hello @IllusionMH
no issues when pasting to the following terminals outside VS code:

  • Windows terminal (cmd.exe)
  • git bash.exe
  • powershell

in vs code I tried successfully pasting the same SHA in VS code

  • powershell
  • cmd

it does not work for git bash inside vs code

not sure what to do at the moment

@Tyriar
Copy link
Member

Tyriar commented Jan 31, 2022

This happens because something (conpty or git bash) turned on bracketed paste mode and it's not properly supported by something. Chances are this is due to microsoft/terminal#395, could also be git bash requests it and doesn't handle it properly.

See https://unix.stackexchange.com/a/196574/115410 for a way to disable it temporarily for that session, VS Code is behaving correctly in this case though.

no issues when pasting to the following terminals outside VS code: Windows terminal (cmd.exe)

This could indicate it's fixed in a later version of conpty (shared component with WT) and you will get the fix eventually when you update Windows.

@Tyriar Tyriar closed this as completed Jan 31, 2022
@Tyriar Tyriar added *out-of-scope Posted issue is not in scope of VS Code upstream Issue identified as 'upstream' component related (exists outside of VS Code) labels Jan 31, 2022
@MV88
Copy link
Author

MV88 commented Jan 31, 2022

ok I've managed to resolve it with the following

bind 'set enable-bracketed-paste off'

and in order to having this working all the time , I've put it inside .bashrc

@Tyriar @IllusionMH thanks for your time

@Tyriar
Copy link
Member

Tyriar commented Jan 31, 2022

@MV88 good to know, I'm actually going to add that to our website FAQ

@Tyriar Tyriar reopened this Jan 31, 2022
@Tyriar Tyriar added this to the February 2022 milestone Jan 31, 2022
@Tyriar Tyriar added polish Cleanup and polish issue terminal-input Relating to typing in the terminal not doing the right thing, IMEs not working, etc. and removed upstream Issue identified as 'upstream' component related (exists outside of VS Code) *out-of-scope Posted issue is not in scope of VS Code labels Jan 31, 2022
@Tyriar Tyriar self-assigned this Jan 31, 2022
@meganrogge meganrogge removed their assignment Feb 1, 2022
@Tyriar Tyriar added the windows VS Code on Windows issues label Feb 2, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Mar 20, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
polish Cleanup and polish issue terminal-input Relating to typing in the terminal not doing the right thing, IMEs not working, etc. windows VS Code on Windows issues
Projects
None yet
Development

No branches or pull requests

4 participants