History partial completion with Up key isn't implemented in git-bash #3019
Replies: 5 comments 2 replies
-
The behaviour you're describing (iterating through all commands sequentially) has been the default on every Linux distribution I've tried, spanning many years. My guess would be that your normal environment has something similar to the following configured, in either
|
Beta Was this translation helpful? Give feedback.
-
Apparently it can also be implemented like this, in one of the various bash initialization files.
|
Beta Was this translation helpful? Give feedback.
-
OMG! I added the two commands you suggest to |
Beta Was this translation helpful? Give feedback.
-
My guess would be it's a backwards compatibility thing, where it was never made default simply because the feature didn't exist (at least in the Bash world) back in the early days and changing that might break the expectations of existing users. As for Git for Windows, I'm pretty sure it simply inherits the upstream defaults from MSYS2 in this area. That being said I certainly find the feature helpful, and any potential disruption stemming from changing this behaviour seems like it would be quite minimal. So perhaps it's worth tweaking the default in this case. @dscho, do you have an opinion on this? I'd be willing to put together a PR if you're comfortable with the idea. |
Beta Was this translation helpful? Give feedback.
-
This will be overwritten the next time you re-install/upgrade/downgrade Git for Windows. It is not intended to be modified by the user. It is not my experience that this is the default in Linux. I am currently using Ubuntu 18.04 via WSL and do not recall being puzzled by the Cursor Up key doing what @AntonioRedondo wants it to do. And quite honestly, if my reaction is any indication, I would be surprised if such a change would go without a ton of very vocal complaints. I know that my muscle memory would be disrupted by that change. Maybe a checkbox in the installer (off by default) might be acceptable. |
Beta Was this translation helpful? Give feedback.
-
Setup
defaults?
to the issue you're seeing?
Nope
Details
Git-bash
Minimal, Complete, and Verifiable example
this will help us understand the issue.
For example, on bash on Linux, if in the terminal is written
and I press the key ↑, the history only will iterate over entries that start by
npm
:However, on Windows using Git-Bash, what it's already written on the terminal will be ignored and when pressing ↑ history will iterate over all entries in reverse chronological order.
If I press ↑ when
npm
is already typed on the terminal:What is written in the terminal is ignored and history will iterate over all entries in reverse chronological order
Beta Was this translation helpful? Give feedback.
All reactions