0

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.

  • It's not `vim`, it's a pager called [`less`](https://linux.die.net/man/1/less). You can scroll it left/right/up/down, search, etc. Press `q` to exit. – phd Mar 02 '22 at 09:04

1 Answers1

0

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

Polo
  • 91
  • 5