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

MSYS2 bash: Cursor display doesn't follow arrow keys after running Emacs #2697

Closed
andreaszapf opened this issue Sep 8, 2019 · 11 comments · Fixed by #4372
Closed

MSYS2 bash: Cursor display doesn't follow arrow keys after running Emacs #2697

andreaszapf opened this issue Sep 8, 2019 · 11 comments · Fixed by #4372
Labels
Area-TerminalControl Issues pertaining to the terminal control (input, selection, keybindings, mouse interaction, etc.) Issue-Bug It either shouldn't be doing this or needs an investigation. Priority-2 A description (P2) Product-Terminal The new Windows Terminal. Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release.
Milestone

Comments

@andreaszapf
Copy link

Environment

Windows build number: [10.0.18362.295]
Windows Terminal version (if applicable): 0.4.2382.0

Any other software?

MSYS2 / MINGW64:

  $ uname -srvo
  MINGW64_NT-10.0-18362 3.0.7-338.x86_64 2019-07-11 10:58 UTC Msys

  $ bash --version
  GNU bash, version 4.4.23(1)-release (x86_64-pc-msys)

Emacs from MSYS2's mingw64/mingw-w64-x86_64-emacs package:

  (emacs-version)
  "GNU Emacs 26.2 (build 1, x86_64-w64-mingw32)
   of 2019-06-03"

Steps to reproduce

  • Run MSYS2 / MINGW64 bash in Windows Terminal, e.g. in a CMD tab with
    set MSYSTEM=MINGW64&& c:\msys64\usr\bin\bash --login -i

  • Run Emacs in the terminal (emacs -nw) and quit it immediately

  • Back at the bash prompt, enter a few characters, say 123

  • Press the left-arrow as often as needed to move the cursor to the
    beginning of the line (in this example 3 times)

  • Enter some other characters

Expected behavior

  • The cursor moves with the left-arrow keystrokes to the beginning of the line

  • New text appears line start

Actual behavior

  • The cursor stays at the end of the line, although the internal position is updated
    and new text appears at line start.

  • When I delete text using Backspace or Delete, the cursor jumps to the correct position,
    but jumps back to the end of line when new text is entered.

It seems that MINGW Emacs and MSYS2 bash don't play well in Windows Terminal -- in
the classic Windows console there is no issue.

This might be related to #2561.

@ghost ghost added Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels Sep 8, 2019
@zadjii-msft
Copy link
Member

@andreaszapf Does this repro in emacs in WSL for you as well, or only the MSYS2 emacs?

@zadjii-msft zadjii-msft added Area-TerminalControl Issues pertaining to the terminal control (input, selection, keybindings, mouse interaction, etc.) Issue-Bug It either shouldn't be doing this or needs an investigation. Product-Terminal The new Windows Terminal. labels Sep 9, 2019
@ghost ghost removed the Needs-Tag-Fix Doesn't match tag requirements label Sep 9, 2019
@andreaszapf
Copy link
Author

@zadjii-msft Emacs in WSL works fine for me. That is, Emacs 25.3.1 on an older WSL (let me know if you need the exact version).

@zadjii-msft
Copy link
Member

Good to know - that means it's specific to the Terminal's VT processing, and not a broader issue with conpty. Thanks for confirming!

@bitcrazed bitcrazed removed the Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting label Sep 9, 2019
@bitcrazed bitcrazed added this to the Terminal v1.0 milestone Sep 9, 2019
@zadjii-msft zadjii-msft added the Priority-2 A description (P2) label Jan 22, 2020
@zadjii-msft
Copy link
Member

@andreaszapf I know that this a long shot, but is this still repro'ing for you? I just tried installing the 20190524 MSYS2 build locally, and this doesn't seem to repro on the 0.8.10091.0 build of the Windows Terminal anymore. I thought I had a fix in #4372 for this, but since it's not even occurring in 0.8, then maybe it was fixed by something else earlier.

@zadjii-msft zadjii-msft added the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label Jan 29, 2020
@andreaszapf
Copy link
Author

@zadjii-msft It's still reproducing for me, I just checked with a fresh MSYS2 install like the one you used (msys2-x86_64-20190524).

Here is what I did step-by-step, after installing MSYS2, in a CMD tab in Terminal:

C:\>set MSYSTEM=MINGW64&& c:\msys64\usr\bin\bash --login -i
$ pacman -S -q --noconfirm mingw64/mingw-w64-x86_64-emacs
$ emacs -nw --eval '(save-buffers-kill-terminal)' # open and immediately close emacs
$ abcde
# cursor can't be moved with arrow keys...

@ghost ghost added Needs-Attention The core contributors need to come back around and look at this ASAP. and removed Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something labels Jan 29, 2020
@zadjii-msft
Copy link
Member

Well that's no good. Doing the exact same thing works fine on my machinetm
image

Maybe this will just go away in the next version with #4372 🤞

@zadjii-msft zadjii-msft removed the Needs-Attention The core contributors need to come back around and look at this ASAP. label Jan 29, 2020
@zadjii-msft zadjii-msft added the Needs-Repro We can't figure out how to make this happen. Please help find a simplified repro. label Jan 29, 2020
@andreaszapf
Copy link
Author

Maybe this will just go away in the next version with #4372 🤞

Seems like it does 😁 -- I finally got around to building Terminal from source (which worked flawlessly 👏), and I'm seeing the issue on master but not on the #4372 branch.

Looking forward to the next release!

@zadjii-msft
Copy link
Member

Oh that's great to hear! I'll tag this up appropriately then. Thanks for taking the time to build this and confirm!

@zadjii-msft zadjii-msft removed the Needs-Repro We can't figure out how to make this happen. Please help find a simplified repro. label Jan 30, 2020
@zadjii-msft zadjii-msft added the Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release. label Jan 30, 2020
@DHowett-MSFT
Copy link
Contributor

I'm .. actually unfortunately still seeing this with 0.9.301.0, which does contain #4372. It trivially reproduces if I hide the cursor and then try to move around my prompt line as well. :/

@DHowett-MSFT DHowett-MSFT reopened this Jan 30, 2020
@DHowett-MSFT DHowett-MSFT removed the Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release. label Jan 30, 2020
@DHowett-MSFT
Copy link
Contributor

Oh, I see. I'm using 25l instead of 12l. Interesting. WT should be hiding the cursor on 25l. Okay. This is just a different issue. 😄

@ghost ghost added the Needs-Tag-Fix Doesn't match tag requirements label Jan 30, 2020
@DHowett-MSFT DHowett-MSFT added Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release. and removed Needs-Tag-Fix Doesn't match tag requirements labels Jan 30, 2020
@ghost
Copy link

ghost commented Feb 13, 2020

🎉This issue was addressed in #4372, which has now been successfully released as Windows Terminal Preview v0.9.433.0.:tada:

Handy links:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-TerminalControl Issues pertaining to the terminal control (input, selection, keybindings, mouse interaction, etc.) Issue-Bug It either shouldn't be doing this or needs an investigation. Priority-2 A description (P2) Product-Terminal The new Windows Terminal. Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants