GNU Screen -- 水平滚动

7 linux unix gnu-screen

我一直在试图解决这个问题——目标是在 GNU Screen 中水平滚动。(为了避免 CLI mysql 查询结果中出现丑陋的换行。)

如果你这样做:

screen -h 5000 # 5000 lines history
Ctrl-a r # to disable horizontal wrap
mysql -u user -p
SELECT * FROM db.big_fat_table LIMIT 500;
Ctrl-a [ # to enter scroll (copy) mode
Run Code Online (Sandbox Code Playgroud)

现在您可以分别使用Ctrl-b和上下滚动Ctrl-d。但是你如何左右滚动?

Gre*_*ill 4

我不认为关闭该wrap选项会起到您认为的作用。这是我的手册页显示的选项wrap

\n\n
\n
wrap [on|off]\n\nSets  the  line-wrap setting for the current window.  When line-wrap is\non, the second consecutive printable character output at the last  col-\numn  of  a  line  will  wrap to the start of the following line.  As an\nadded feature, backspace (^H) will also wrap through the left margin to\nthe previous line.  Default is \xe2\x80\x98on\xe2\x80\x99.\n
Run Code Online (Sandbox Code Playgroud)\n
\n\n

这是一个低级终端功能,与水平滚动无关。

\n\n

但是,less有一个功能可能会对您有所帮助,该-S开关允许您使用左右箭头键在文件中左右滚动。如果您正在查看包含长行的结果文件,这可能非常有用。

\n