【问题标题】:How to display previous shell commands after exiting vim in macOS Terminal?在 macOS 终端中退出 vim 后如何显示以前的 shell 命令?
【发布时间】:2013-08-20 11:56:37
【问题描述】:

我正在使用 macOS 终端应用程序。当我退出 vim 时,我正在编辑的文件的文本仍保留在我的屏幕上,并与我之前输入的命令重叠,所以我看不到我之前的任何命令。如何更改此行为以便查看我之前的命令?

我找到了这篇文章 How can I stop VI from overlapping and hiding the last page of command line output? 但我没有看到altscreen 命令。

【问题讨论】:

  • altscreen 是一个 GNU 屏幕命令,应该可用于 OSX。尝试在终端输入screen
  • 感谢 Thor,我现在正在做“人屏”,看看它能做什么。

标签: bash vim screen


【解决方案1】:

altscreen 只有在 screen 会话中使用 Vim 时才有用。如果你不这样做,那就无关紧要了。

在 iTerm 中,您描述的行为由 Preferences 窗口中的禁用保存/恢复备用屏幕复选框控制:

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

取消选中它以恢复您之前的提示和命令输出。

在终端中,默认行为是您想要的行为,我在选项中看不到任何会改变它的东西。

【讨论】:

    猜你喜欢
    • 2019-01-30
    • 2021-10-25
    • 2017-01-15
    • 1970-01-01
    • 2016-01-27
    • 2020-02-06
    • 1970-01-01
    • 2022-11-29
    • 2021-08-17
    相关资源
    最近更新 更多