-
-
Notifications
You must be signed in to change notification settings - Fork 601
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Behavior of Ctrl+C is not intuitive when OSv is run with interactive shell #49
Comments
On Wed, Oct 2, 2013 at 1:53 PM, Tomasz Grabiec notifications@github.comwrote:
Yes, it's not exactly intuitive but I actually find the current behavior I think it would be best to have both behaviors as options to run.py, like
A more complicated issue (that Avi and I were discussing this morning) is
Nadav Har'El |
2013/10/2 nyh notifications@github.com
You are right that Ctrl+U does clear the shell but in this issue I am
|
I'm certainly in favor of changing the default behavior of Ctrl-C not to kill QEMU. |
And you could still kill the QEMU from the console with ctrl+a x 2013/10/2 Pekka Enberg notifications@github.com
|
Awesome, just like with the KVM tool! :-) |
On 10/02/2013 07:53 AM, Tomasz Grabiec wrote:
|
On 10/02/2013 10:03 AM, Pekka Enberg wrote:
I think it makes sense to kill qemu (through poweroff) if we are not |
In all popular shells when you are entering a command and you press Ctrl+C the shell starts a new prompt below and the old text is visible above. This patch leverages a change in jline which allows interruption of readline() invocations. See cloudius-systems/osv#49
In all popular shells when you are entering a command and you press Ctrl+C the shell starts a new prompt below and the old text is visible above. This patch leverages a change in jline which allows interruption of readline() invocations. See cloudius-systems/osv#49
This is in order to make it send Ctrl+C to the guest instead of killing the VM. Leads to less surprises when working with interactive shell inside OSv. To suppress the new behavior run with --g or --with-graphic. Relates to issue #49. Signed-off-by: Tomasz Grabiec <tgrabiec@cloudius-systems.com>
Closing this bug, issue #53 is a new spinoff. |
Sorry, didn't realise you didn't push the fix yet :( |
This patch adds interrupt (by default ctrl-C) and quit (by default ctrl-\) handling to the console driver, when the ISIG termios flag is enabled (and this patch enables this flag by default). The application can change these characters or disable ISIG with ioctls, exactly as in Unix. The ^C character sends a SIGINT to the (only) process, and ^\ sends SIGQUIT. By default both abort OSv, but when running Java we get a much more interesting SIGQUIT handler - it shows a trace of all running threads and other information. Note that our line-discipline code currently sits in the console driver (we do not have ptys yet), so it only applies to the console, not to SSH connections or the likes. Also note that by default (before the patch to issue #49), qemu will catch the ^C and ^\ and won't even pass them to OSv, so apply the patch to #49 (or change the interrupt or quit characters) to see this feature working. This patch relates to issue #53. Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
@tgrabiec, can we (you) close this issue? I think it refers to the shell we don't use any more. If we still have specific ^C issues (and we always will complain about ^C, as long as we consider OSv single-application but still want to run several applications...), we can open a new issue. |
what about right-control-C passes to OS and left-control-C to the guest? |
Hi Michele, giving right-control-C and left-control-C different behavior is not something that Unix users would expect. Worse, when the guest is using the serial port instead of VGA (this is what happens by default when you run through qemu), there is no support at all for left or right control keys (pressing control-C, of either variant, will send character \003 on the emulated serial port). So your idea cannot work. In any case, I think the current behavior is quite reasonable, don't you? Right now, control-C is passed to the guest, which might do anything it pleases with it, but the default behavior is to power off the guest. If the guest catches control-C and you nevertheless want to kill it, qemu provides a convenient way to kill a guest type "control-A x" (that's "control-A" followed by "x"). That can be used for killing any guest in qemu, not just an OSv guest. So I think the current behavior is most reasonable, and most similar to what users would expect from Linux guests, so I think we should keep this issue closed. |
Currently when you hit Ctrl+C the qemu terminates and the OS is brought down. If I start OSv with intent to use its command line interface this behavior is not intuitive as I expect that when I'm in a shell hitting ^C will clear the command line.
A solution to this could be to:
Downside of this approach would be that one would not be able to kill OSv from console using Ctrl+C.
I'm interested in your opinions on that one.
The text was updated successfully, but these errors were encountered: