'Mac(m1 chipset) Terminal Problem : everything looks like vim editor
Once I used sudo vim to write and save a hidden file(like .gitignore).
after that, I happened to use git log, and the result is:
enter image description here
Nothing else appears in the terminal, no scroll allowed.
And the second:
I ran git branch -r, and the result is:
enter image description here enter image description here: when I scrolled terminal screen.
This looks quite like vim editor, like the only way to 'END' that is typing 'q'.
and the Third:
I used brew update, but terminal doesn't show any progress on the screen and
enter image description here
all the progress was showing on this bar.
How can I rollback my terminal to normal? Same thing happens in VScode also.
Solution 1:[1]
This is a pager called less. As phd answered in the comments, you can quit out of it with q. The branch option for the git command can be reset to not use the pager:
git config --global pager.branch false
This is popular because a lot of people don't like that behavior for git branch, and it's actually a question answered here.
Note, confusing the two (vim and less) is common. It's understandable because there are a lot of navigation keys in common between vim and less, as well as many other tools in Unix. This is one reason why learning vim is hard but so very useful. Some examples:
j k u d e y q space 50% gg G /
Two cheatsheets with several of these common commands: vim less
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 |
