git-for-windows / git

A fork of Git containing Windows-specific patches.
http://gitforwindows.org/
Other
8.28k stars 2.51k forks source link

git commands at windows command prompt corrupt key mappings for arrows #4551

Open djgoldman opened 1 year ago

djgoldman commented 1 year ago

Thank you for filling out a Git bug report! Please answer the following questions to help us understand your issue.

What did you do before the bug happened? (Steps to reproduce your issue) git status git pull

What did you expect to happen? (Expected behavior) commands complete without impacting windows command history

What happened instead? (Actual behavior) git status works normally and doesn't corrupt anything git fetch works normally but leaves windows command history corrupt. Up arrow gets me "^[[A" instead of the previous command. No combination of ctrl, shift or alt modifiers make it any better. git status works normally and corrects the issue.

What's different between what you expected and what actually happened? Don't expect windows command prompt's command history to give garbage characters.

Anything else you want to add: This doesn't happen immediately but does start soon after starting work. The git fetch/git status behavior is reproducable once it starts happening.

Please review the rest of the bug report below. You can delete any lines you don't wish to share.

[System Info] git version: git version 2.41.0.windows.3 cpu: x86_64 built from commit: 4a1821dfb0c2160a4fcc85d2845f095c54339578 sizeof-long: 4 sizeof-size_t: 8 shell-path: /bin/sh feature: fsmonitor--daemon uname: Windows 10.0 19044 compiler info: gnuc: 13.1 libc info: no libc information available $SHELL (typically, interactive shell):

[Enabled Hooks]

dscho commented 1 year ago

I cannot confirm that behavior here. The arrow keys work as expected.

djgoldman commented 1 year ago

Likely not a git bug then but something impacted by it. Happening on my computer after power cycling and upgrading to latest git package. Thanks for checking. Sent from an iPhone so don't blame my typingOn Aug 11, 2023, at 2:16 AM, Johannes Schindelin @.***> wrote: I cannot confirm that behavior here. The arrow keys work as expected.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>

mataha commented 2 months ago

Might be related to #4700 - ^[[A instead of up arrow is typically a symptom of not resetting terminal state via SetConsoleMode(), particularly lingering ENABLE_VIRTUAL_TERMINAL_PROCESSING. Executing any binary that uses the aforementioned function (even something as simple as timeout /?) should bring the console back to normal.

dscho commented 1 month ago

Might be related to #4700 - ^[[A instead of up arrow is typically a symptom of not resetting terminal state via SetConsoleMode(), particularly lingering ENABLE_VIRTUAL_TERMINAL_PROCESSING.

If so, then it might be related to https://github.com/git-for-windows/git/pull/4968, too...

djgoldman commented 1 month ago

timeout /?   worked.

Sent from an iPhone so don't blame my typing