[英]How to use same terminal window after using “rails server” command?
Okay here's my problem. 好的,这是我的问题。 I type in "rails s" and then my terminal won't let me type in any commands.
我输入“rails s”,然后我的终端不会让我输入任何命令。 So I have to start a new terminal window, which is pretty annoying.
所以我必须开始一个新的终端窗口,这非常烦人。
On the other hand I can type in "rails s -d" which detaches, and then it's a pain to stop the server when I need to. 另一方面,我可以键入“rails s -d”进行分离,然后在需要时停止服务器会很痛苦。 (Instead of using control+c, I have to find the PID and use kill -9 PID)
(而不是使用control + c,我必须找到PID并使用kill -9 PID)
I'm not a professional, so if anyone has any advice it would be much appreciated, thank you! 我不是专业人士,所以如果有人有任何建议,我将不胜感激,谢谢!
I don't believe there is a way to do the thing you are specifically asking for. 我不相信有办法做你特别要求的事情。
However, I use Iterm2 which allows me to open multiple terminal windows in one window, either by splitting my iTerm2 window or by creating multiple tabs. 但是,我使用Iterm2 ,它允许我在一个窗口中打开多个终端窗口,通过拆分我的iTerm2窗口或创建多个选项卡。 That way I can just make the terminals that are holding rails server and my development.log tail very small unless something interesting happens in them.
这样我就可以让持有rails服务器的终端和我的development.log尾部非常小,除非它们发生了一些有趣的事情。
I use screen, you can also use TMUX but they are window managers in terminal and you can create multiple windows in same terminal window :) 我使用屏幕,你也可以使用TMUX,但它们是终端的窗口管理器,你可以在同一个终端窗口创建多个窗口:)
Read up on them at WikiVS as that might help you :) http://www.wikivs.com/wiki/Screen_vs_tmux 在WikiVS上阅读它们,因为这可能对你有帮助:) http://www.wikivs.com/wiki/Screen_vs_tmux
Screen: http://www.gnu.org/software/screen/ TMUX: http://tmux.sourceforge.net/ 屏幕: http: //www.gnu.org/software/screen/ TMUX: http ://tmux.sourceforge.net/
So you can easily switch and maintain same terminal window. 因此,您可以轻松切换和维护相同的终端窗口。 You can't obviously use the EXACT same window that rails server running but it's close enough without having to do the searching for the PID.
显然,您无法使用运行轨道服务器的EXACT相同窗口,但它足够接近而无需搜索PID。
You can type: rails s &
. 您可以输入:
rails s &
。 I'm not sure if this is what you meant. 我不确定这是不是你的意思。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.