简体   繁体   English

退出后,xterm将页面从终端中减少

[英]xterm keep page from less in terminal after exit

I often view files using less and want to remember what i have just seen in the file. 我经常使用less来查看文件,并想记住我刚刚在文件中看到的内容。 However when I quit less by pressing the q key my xterm window removes the page of less showing the file and only shows my command prompt. 但是,当我按q键退出时,我的xterm窗口删除了少显示文件的页面,只显示了我的命令提示符。

How do I keep the less output on my terminal when I quit? 当我退出时,如何在终端上保持较少的输出?

less -X 少-X

Use the -X option from the less man page described below: 使用下面描述的less man页面中的-X选项:

   -X or --no-init
          Disables  sending  the  termcap  initialization and deinitialization strings to the terminal.
          This is sometimes desirable if the deinitialization string does something  unnecessary,  like
          clearing the screen.

Actually, if you are using xterm (rather than some other program), the choice of whether to honor alternate-screen escape sequences can be done readily using a menu selection Enable Alternate Screen Switching (or resource setting). 实际上,如果您正在使用xterm (而不是其他程序),则可以使用菜单选择“ 启用备用屏幕切换” (或资源设置)来选择是否遵循备用屏幕转义序列。 The less option does not apply to other programs such as vi . less选项不适用于其他程序,如vi

In the manual, this is the titeInhibit , named after the termcap settings 在手册中,这是titeInhibit ,以termcap设置命名

  • ti (terminal initialization) ti(终端初始化)
  • te (terminal ending) te(终点结束)

and in the FAQ, this is Why doesn't the screen clear when running vi? 在FAQ中,这就是为什么运行vi时屏幕不清晰? .

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM