简体   繁体   English

清除Rails服务器中的终端

[英]Clear the terminal in rails server

In terminal, you can clear the terminal by typing $ clear (gives a large block of clear lines) or control+l (although this only moves the last line to to top). 在终端中,您可以通过键入$ clear (提供大量的清晰行)或control + l(尽管这只会将最后一行移到顶部)来清除终端。 How do you accomplish this once you have started the server using $ rails s , or am I stuck with just holding return/enter for a while? 使用$ rails s启动服务器后,如何完成此操作?或者我只停留一会儿return / enter吗?

In gnome terminal: Terminal -> Reset and Clear . 在gnome终端中: Terminal -> Reset and Clear

在此处输入图片说明

I mapped it to CTRL + k . 我将其映射到CTRL + k

+ K for OSX ⌘+ K为OSX

In Ubuntu, 在Ubuntu中,

system 'clear'

In Windows 在Windows中

system 'cls'

Note: If you are using terminal inside some IDE like MyEclipse then you can remove terminal data by pressing "Clear Console" that is at right side of console even while server is running. 注意:如果在某些MyEclipse IDE中使用终端,那么即使服务器正在运行,也可以通过按控制台右侧的“清除控制台”来删除终端数据。 Like that different IDE's have different ways of clearing console data. 像那样,不同的IDE具有清除控制台数据的不同方法。 For standalone console like the ubuntu terminal or Windows terminal while server on run, you can't remove data. 对于服务器运行时的独立控制台(如ubuntu terminalWindows terminal ,您无法删除数据。

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

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