且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

禁用Psql输出中的换行

更新时间:2022-06-24 22:35:24

Psql 使用系统查看器在控制台中显示其输出。在 bash 中,它可能会将 less 用于其提供的可滚动/可页面化功能。要使用其他查看器或使用其他设置,您只需要设置 PAGER 环境变量。

Psql uses a system viewer to show its output in the console. In bash it likely uses less for the scrollable/page-able features it provides. To use a different viewer or use different settings, you just need to set the PAGER environment variable.

运行 psql 以将 less -S -长切线选项似乎对我有用:

Running psql to use less with the -S or --chop-long-lines option seemed to work for me:

PAGER="less -S" psql

您也可以在输入 -S Enter的 less 中查看输出时启用此功能。 kbd>。

You can also enable this feature while viewing output in less by typing -S and Enter.