【问题标题】:Can linux or mac terminal commands scroll up instead of down?linux 或 mac 终端命令可以向上滚动而不是向下滚动吗?
【发布时间】:2014-10-10 22:41:49
【问题描述】:

我想知道是否有一种方法可以设置 linux 或 mac 终端,以便您始终在终端屏幕顶部输入命令,而之前的命令在它下方。

例子

-----Screen top----
>EnterCommand
>PreviousCommand 1
>final line of Previous Command 1 output 
>second to final line of previous command 1 output
-----Bottom of screen-----

谢谢!

【问题讨论】:

    标签: linux macos command-line terminal


    【解决方案1】:

    standard *nix terminal driver没有内置这样的功能;必须专门编写一个终端应用程序来将换行符和换行转换为向上运动而不是向下运动。请注意,这可能会破坏许多TUI 应用程序,因此不建议将它们与此类终端应用程序一起使用。

    【讨论】:

      【解决方案2】:

      这似乎非常接近您的要求:

      https://github.com/swirepe/alwaysontop

      要使用它运行:

      git clone https://github.com/swirepe/alwaysontop.git
      cd alwaysontop/
      source alwaysontop.sh
      

      如果您决定喜欢它,只需在您的 .bashrc 或 .bash_profile 中使用以下内容获取它:

      echo "source ~/alwaysontop/alwaysontop.sh" >> ~/.bashrc
      

      希望有帮助!

      【讨论】:

      • 这看起来正是我所需要的,但它对我不起作用。我发布了一个问题。我们会看看是否有任何结果。
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-06-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多