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

Backspace, left and right in Windows integrated terminal cause prompt to go out of sync in Git bash #7345

Closed
JasonKleban opened this issue Jun 7, 2016 · 19 comments
Assignees
Labels
*duplicate Issue identified as a duplicate of another issue(s) help wanted Issues identified as good community contribution opportunities terminal Integrated terminal issues upstream Issue identified as 'upstream' component related (exists outside of VS Code) windows VS Code on Windows issues
Milestone

Comments

@JasonKleban
Copy link

  • VSCode Version: 1.2.0-insider
  • OS Version: Windows 10
  • Terminal: Git bash

Steps to Reproduce:

  1. Invoke the new integrated terminal
  2. type command
  3. backspace to delete some characters
  4. Notice that while the command executed will be accurate to what was typed, the display of the line will be out of sync with the internal state of the terminal.
@Tyriar
Copy link
Member

Tyriar commented Jun 7, 2016

I haven't actually seen this, could you include a screenshot or a gif? I'm assuming you set it to the bash.exe not the git bash executable also?

@Tyriar Tyriar added bug Issue identified by VS Code Team member as probable bug terminal Integrated terminal issues windows VS Code on Windows issues labels Jun 7, 2016
@Tyriar Tyriar self-assigned this Jun 7, 2016
@JasonKleban
Copy link
Author

OK, this is happening very easily to me. Unfortunately I couldn't figure out any modern programs that show the actual keystrokes in an overlay for Windows (anybody know??) and this isn't a great capture, but it does show it happening a few times, should be obvious without the keystrokes showing. On the first line when I try to delete all the text including "echo", I can't backspace any more but the echo still shows. executing what looks like echo whatever is really just whatever in the buffer.

Then the next line I just show that echo whatever without any backspaces normally works fine and got a surprise that the newline wasn't printed!

Then I tried a third example and that one exhibited no glitches finally.

echo

@moshahmed
Copy link

moshahmed commented Jun 17, 2016

Windows7 Start > cmd > cd c:\gitportable-209-x64\bin > bash.exe
user@host MING64 /bin
$ ast (backspace becomes space)

This problem is probably due to using incompatible versions of the cygwin DLL.
Search for cygwin1.dll using the Windows Start->Find/Search facility
and delete all but the most recent version. The most recent version should
reside in x:\cygwin\bin, where 'x' is the drive on which you have
installed the cygwin distribution. Rebooting is also suggested if you
are unable to find another cygwin DLL.
Segmentation fault

@gerane
Copy link

gerane commented Jun 22, 2016

I get this in powershell too. I don't use cygwin so it is not caused by that when I am in PowerShell.

@gerane
Copy link

gerane commented Jun 22, 2016

I also see issues when moving left and right. The visual cursor can get slightly out of sync with where it really is. Usually it is a space or 2 when it happens.

@Tyriar Tyriar changed the title Backspace in terminal not working (in git bash within Windows 10?) Backspace, left and right in Windows integrated terminal cause prompt to go out of sync Jul 29, 2016
@Tyriar Tyriar added the upstream Issue identified as 'upstream' component related (exists outside of VS Code) label Jul 29, 2016
@Tyriar
Copy link
Member

Tyriar commented Aug 1, 2016

@gerane I feel like this is fixed in Insiders now, I can't reproduce anymore. Have you seen it recently?

@gerane
Copy link

gerane commented Aug 2, 2016

@Tyriar I still see the visual cursor in the wrong place occasionally. Almost always by a single space.

It might show in one spot but is really 1 to the left or right. If I move the cursor, the visual cursor might lag behind or skip ahead by 1 space of where the actual cursor is located. Then if I enter input it isn't input where the visual cursor shows it should be.

@Tyriar Tyriar added this to the August 2016 milestone Aug 29, 2016
@Tyriar
Copy link
Member

Tyriar commented Aug 29, 2016

Cannot repro:

  • "terminal.integrated.shell.windows": "\\windows\\system32\\cmd.exe"
  • "terminal.integrated.shell.windows": "\\windows\\sysnative\\cmd.exe"
  • "terminal.integrated.shell.windows": "powershell.exe"
  • "terminal.integrated.shell.windows": "C:\\Windows\\sysnative\\WindowsPowerShell\\v1.0\\powershell.exe"

Can repro:

  • "terminal.integrated.shell.windows": "C:\\Program Files\\Git\\bin\\bash.exe"

Updating Windows now to try "C:\\Windows\\sysnative\\bash.exe", I think i need to wait a while to get the update.

@Tyriar
Copy link
Member

Tyriar commented Aug 29, 2016

Moving to September since endgame is starting and this is lower priority than originally thought.

@Tyriar Tyriar modified the milestones: September 2016, August 2016 Aug 29, 2016
@Tyriar Tyriar changed the title Backspace, left and right in Windows integrated terminal cause prompt to go out of sync Backspace, left and right in Windows integrated terminal cause prompt to go out of sync in Git bash Sep 6, 2016
@Tyriar Tyriar modified the milestones: Backlog, September 2016 Sep 15, 2016
@JamesEarle
Copy link

JamesEarle commented Oct 13, 2016

Related to this (shown below), when you type any command that has parameters in quotation marks, typing somecommand "" and then using left arrow to move the cursor back between the quotation marks will throw it out of sync. Specifically, it will insert additional quotation marks while you're typing.

vscode_bug

@Tyriar Tyriar added the help wanted Issues identified as good community contribution opportunities label Oct 13, 2016
@PontusRenmarker
Copy link

PontusRenmarker commented Nov 2, 2016

Hi!
Backspace works as a space button for me. I am unable to reproduce what @JasonKleban displayed.
But I can reproduce the problem with quotations and left arrow in git bash but not in either powershell or cmd. Running windows 10 pro N.

Have you found any working solution?

EDIT:

Re-installed git bash and it is now working. Cannot reproduce the problem I had before.

@ffes
Copy link

ffes commented Nov 4, 2016

With the Cygwin bash this problem occurs this well.

@plhosk
Copy link

plhosk commented Nov 17, 2016

This problem is happening for me on Windows 10 (version 1607 build 14393.447) with VSCode 1.7.1 and Git for Windows 2.10.2.

When I use bash.exe as the integrated terminal, the backspace or arrow keys cause the cursor to become out of sync with what's printed on the screen.

@Tyriar
Copy link
Member

Tyriar commented Nov 18, 2016

I've started tracking all issues like this in #14613 as I believe they're all related.

@Tyriar Tyriar closed this as completed Nov 18, 2016
@roblourens roblourens added *duplicate Issue identified as a duplicate of another issue(s) and removed bug Issue identified by VS Code Team member as probable bug labels Dec 8, 2016
@Tyriar
Copy link
Member

Tyriar commented Jan 16, 2017

This should hopefully be fixed in tomorrow's Insiders build (via 63f1fa6). Please let me know if it still reproduces.

See #13625 for more information.

@tqwewe
Copy link

tqwewe commented Jan 20, 2017

I have had this out of sync issue in the Visual Code terminal with git bash since I downloaded Visual Code (a few months ago) and it has never been solved.
I just downloaded the Visual Code Insiders Build and I can confirm it is now working correctly.

Looking forward to when this terminal fix will be updated to the regular Visual Code.

@Tyriar
Copy link
Member

Tyriar commented Jan 20, 2017

@acidic9 great to hear! It's likely around 2 weeks off.

@Kenya-West
Copy link

Same here, man. It happens on different sizes of window.

Specs:
Windows 10 Creators Update x64
VS Code up-to-date
bash (Ubuntu on Windows)/Powershell/Whatever
terminal-is-out-of-sync

@Tyriar
Copy link
Member

Tyriar commented May 15, 2017

@Kenya-West that issue is #19665

@microsoft microsoft locked and limited conversation to collaborators May 15, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*duplicate Issue identified as a duplicate of another issue(s) help wanted Issues identified as good community contribution opportunities terminal Integrated terminal issues upstream Issue identified as 'upstream' component related (exists outside of VS Code) windows VS Code on Windows issues
Projects
None yet
Development

No branches or pull requests