views:

58

answers:

1

Hey guys. I'm able to send Rails consoles to the background with CTRL+Z . However, when I bring back the console with "fg", the console's no longer responsive.

It doesn't respond to normal commands, or even "quit" or CTRL+C. I have to background it again with CTRL+Z , and then kill it with "kill %1".

Here's an example:

[nickh@chameleon ~/foo] jobs
[nickh@chameleon ~/foo] script/console
Loading development environment (Rails 2.3.5)
>> 1
=> 1
>>
[1]+  Stopped                 script/console
[nickh@chameleon ~/foo] jobs
jobs
[1]+  Stopped                 script/console
[nickh@chameleon ~/foo] fg
script/console
1
quit
^C
^Z
[1]+  Stopped                 script/console
[nickh@chameleon ~/foo] jobs
[1]+  Stopped                 script/console
[nickh@chameleon ~/foo] kill %1
[1]+  Terminated              script/console
[nickh@chameleon ~/foo] jobs
[nickh@chameleon ~/foo]

Might anyone know how to fix this?

Thanks!

+1  A: 

Traditionally *nix programs operated in one of two screen modes, either on a single line basis, like the shell or in a "Full screen" mode where you could address the whole screen and use the arrow keys etc to move around. This second mode does not always play well when put into the background.

Whilst I don't see this problem on any of the *nix versions avalable to me, I can understand that you may see it on various *nix flavours. Unfortunately I am not aware of any simple solution to this issue, other than changing the way you work. You could open multiple terminal windows rather than suspending processes or perhaps you could look at the "screen" program that may handle this situation better.

Steve Weet
Hey Steve. Thanks for that information. I do all of my work in GNU Screen, actually.I just tried the Rails console (and IRB) outside of Screen, and found that backgrounding and then restoring the console worked perfectly.So I'm guessing that one or more of my Screen settings is causing problems.I'm going to comment out sections of ~/.screenrc and see if anything alleviates the problem.Thanks again!
nickh
No problem. So my solution was exactly the opposite of what was required then!
Steve Weet