-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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
Ctrl-c doesn't seem to work in web terminal #1227
Comments
Works for me. What OS & browser are you on? |
Mac OS X, Chrome (also doesn't work in Safari) |
Same as #104 I think? |
I think #104 is about copy/paste, and this is about interrupting programs using Ctrl-C. Both are likely terminado issues rather than something we can fix, though there's a small chance that this is something on our side. |
Reporting the same issue on Mac OS Chrome terminals. Cannot interrupt process in terminal with Ctrl+C |
Same problem with with Ubuntu 14.04 & Firefox. |
I'm under the same issue, using MacOS El Capitan... |
I had the same problem and (at least in my case) this is a problem with the terminal shortcuts. I'm on Linux and in the terminal I did: |
Maybe the Jupyter terminal should overwrite some of the browser's default shortcuts: |
I should add that it's working for me using Chrome on MacOS Sierra. I understand that CTRL+C on Windows is copy and I don't think there is anything we can do to override that, but I'm curious what shortcut do you use to kill a process in the Window's terminal? Linux? |
I'm using Chrome under Linux and there it's not working either for the same reason. Hence, my proposal to prevent the default event handling in these cases. |
But what if you want to copy something from the terminal output? |
On Linux, GUI Ctrl shortcuts typically become Ctrl-Shift in a terminal - Ctrl-Shift-C for copy, Ctrl-Shift-N for new window. It's up to the terminal emulator, though. That leaves shortcuts like Ctrl-C for sending control characters to the terminal (which the pty may then translate into signals, e.g. SIGINT). The default command prompt in Windows doesn't have shortcuts for things like 'copy', as far as I know - you have to initiate copying with the mouse. I'm not sure what other Windows terminal emulators do. |
@takluyver Any ideas on how to resolve this for Windows users? |
Resolve what? It should work the same for users running the browser in Windows against a Unix server, and the terminal isn't supported when the server runs on Windows. |
Ok, I wasn't sure if the terminal is the notebook was working as expected or not. So nothing needs to be done then? |
It sounds like there is a problem for some people, but it's not clear under what conditions it occurs. The behaviour I'd expect in a terminal is:
Browser limitations may prevent us from implementing 2, because we can only access the clipboard when the browser's own mechanisms handle a clipboard shortcut. But it sounds like there are some problems with 1. This is probably an issue with xterm.js, and it may already be fixed, either in a version we've already bundled into Jupyter since it was reported, or a still newer version. But without a reliable way to reproduce it, we don't really know. |
Ok, thanks for breaking this down, @takluyver. I guess it wouldn't hurt to bump our xterm.js dependency in the notebook. I'll do that now.... I took a look at the xterm repo and there doesn't seem to be any outstanding issues or recently submitted PRs regarding using |
This still exists and is not fixed. This is a serious problem for me... I can't have students exit their Flask Python programs they run in terminals. CTRL-Z works, CTRL-C does nothing but print '^C'. I am on OS X in Chrome. It also happens in Firefox and Safari. Does anyone have ideas? I could even try to fix this if someone can tell me what needs fixing. |
On Windows |
Unfortunately we haven't figured out what needs fixing - we can't reproduce the problem, so it's hard to investigate. Now that terminals are supported when Windows is on the backend as well, there may be a bug there. If you can reproduce the problem, can you try:
|
This still exists and is not fixed. |
I've found a way to rep both the correct and the incorrect behaviour. Exec summaryCtrl+C fails when I start jupyter remotely via ssh. VersionsJupyter 6.0.3, Python 3.7.7, RHEL 6 or 7. DetailsIf I ssh to the server directly, run jupyter, then log out, Ctrl+C interrupts programs: nohup "jupyter notebook --no-browser" < /dev/null > $remote_tmp_file 2>&1 & However, if I try executing the exact same command from my machine, via ssh -q "nohup jupyter notebook --no-browser < /dev/null > $remote_tmp_file 2>&1 &" AFAIK everything else works. I have to try now with |
It's even easier to reproduce. Create #!/bin/sh
nohup jupyter notebook >jupyter.log 2>&1 & Remember to Now try: ./run.sh ... and Alternatively, kill previous notebook and try: source ./run.sh ... then |
Possible workaround: ^C works for me inside
(I'm running the terminal in Lab, but couldn't find a similar issue on that repo.) |
This is Jupyter notebook server 4.1.0
Ctrl-c doesn't seem to do what I would expect, e.g. if I do something like "tail -f foo" and then hit "ctrl-c", it doesn't exit "tail". It just prints "^C" on the screen.
The text was updated successfully, but these errors were encountered: