网络似乎充满less
了默认情况下停止包装长行并截断它们的资源。我有相反的问题。这是默认的斩波,我想让它停止。我希望默认情况下重新启用自动换行,但我能找到的只是相反的说明。我试过逆转它们,但似乎没有一种方法被用来逆转。
我的问题大约在一个月前出现并且涉及多个系统。我怀疑它实际上可能是我的 dotfiles 某处,但对于我的生活,我找不到它。
less
没有别名到我的 shell 中的任何东西,它不是一个函数,我也没有得到除系统默认值以外的一些二进制文件:
$ which less
/usr/bin/less
Run Code Online (Sandbox Code Playgroud)我不是在-S
争论:
$ ps waux | grep less
caleb 3151 0.0 0.0 13592 1036 pts/14 S+ 16:06 0:00 less
Run Code Online (Sandbox Code Playgroud)我没有设置任何东西~/.lesskey
:
$ cat ~/.lesskey
cat: /home/caleb/.lesskey: No such file or directory
Run Code Online (Sandbox Code Playgroud)然而,行斩波在它实例化的任何地方都被打开。-SEnter每次都得关掉。
手册页明确指出这与预期行为相反:
$ man less
...
-S or --chop-long-lines
Causes lines longer than the screen width to be chopped (truncated)
rather than wrapped. That is, the portion of a long line that does
not fit in the screen width is not shown. The default is to wrap long
lines; that is, display the remainder on the next line.
...
Run Code Online (Sandbox Code Playgroud)
因为它是默认设置,所以似乎没有命令行开关来关闭它。还有什么地方可以设置它以便我可以找到它并根除它?