简体   繁体   中英

How to display previous shell commands after exiting vim in macOS Terminal?

I'm using the macOS Terminal app. When I exit vim, the text of the file I was editing remains on my screen and overlaps the commands I typed previously, so I can't see any of my previous commands. How can I change this behavior so I can see my previous commands?

I've found this post How can I stop VI from overlapping and hiding the last page of command line output? but I don't see the altscreen command.

altscreen is only useful if you use Vim inside a screen session. If you don't, it's irrelevant.

In iTerm, the behavior you describe is controlled by the Disable save/restore alternate screen checkbox in the Preferences window:

Profiles > Terminal > Disable save/restore alternate screen > (uncheck the checkbox)

Uncheck it to get your previous prompts and command outputs back.

In Terminal, the default behavior is the one you want and I don't see anything in the options that would change it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM