Reputation: 14435
Sometimes, when using certain commands within Powershell, the console is set into some kind of "interactive mode", which makes it behave in a way that's completely unusable for me, so I have to restart the console. I'm not sure whether it's a bug in Powershell or a feature I do not know about.
Here's a way to reproduce it (however, this is by far not the only way it happens):
git reflog
.HEAD
positions, which most of the time is a list of the last commits.cls
to clear the console screen.Now, the console is in this weird mode. When I start typing, the console accepts some of the typed characters as usual, but some key presses seemingly let the console display fragments of the previous git reflog
command.
Here is an example: In a fresh powershell console, I did the steps described above. Then I entered abcdefghijklmn
. This is what this console is looking now:
As you can see, the characters j and l were treated like some commands that printed parts of the git reflog
output to the console window, but below the prompt.
Is that a bug or a feature? Anyone else having these problems?
Upvotes: 4
Views: 207
Reputation: 22122
less
(default Git pager) does not interpret Ctrl+C as a quit command. You can open a new console window where less
will be the only application attached to it: start git reflog
to verify that.
When you press Ctrl+C and less
is not the only application attached to the current console window, then Ctrl+C gets received by the shell (PowerShell or CMD), and the shell asks the user for more input. You can see in task manager that after you press Ctrl+C, less
is still running, although the shell prints a new prompt for you. So now you have two applications which compete for single console window input buffer: some keys will be received by the first application, while other keys by the second application.
You need to type q and Enter multiple times to make sure less
will receive its q
.
Upvotes: 3