简体   繁体   中英

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. 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. (Instead of using control+c, I have to find the PID and use 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. 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.

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 :)

Read up on them at WikiVS as that might help you :) http://www.wikivs.com/wiki/Screen_vs_tmux

Screen: 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.

You can type: rails s & . I'm not sure if this is what you meant.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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