Thu 05 Mar 2015 02:58:01 AM UTC, comment #13:
The cset works for me. I can now interrupt an ordinary m-file started in the editor, by using Ctrl+C in the command window.
|
Wed 04 Mar 2015 08:11:10 PM UTC, comment #12:
I have pushed changeset
http://hg.savannah.gnu.org/hgweb/octave/rev/26281bc8d23b
which fixes the issue with interrupting function executed via the editor.
If the function name is not a valid identifier Fsource () is used which is not interruptable by Ctrl-C.
|
Mon 02 Mar 2015 10:37:33 PM UTC, comment #11:
Fsource and Ffeval can not be interrupted by Ctrl-C (is there a reason why?). When switching back to executing the function via the command-editor, Ctrl-C works again. I will prepare changeset.
@Jordi: Concerning the possible shell injection discussed in bug #42307, if the function name is checked for a valid identifier before executing via command-editor, there should be no risk for a shell injection, is that right? If so, I propose to execute via command-editor if the function name is a valid identifier and via Fsource if it is not (without debugging and without Ctrl-C).
|
Mon 02 Mar 2015 04:06:33 PM UTC, comment #10:
@Torsten: On Linux, Ctrl+C does not work when the script is launched from the editor.
Steps:
1) Open tst_loop.m in editor
2) Run script with "Save File and Run" button
3) Switch to Command Window
4) Enter Ctrl+C (many times)
5) script completes normally
On Windows, it works. But, I may have an old version before you made the change from Fsource to Feval.
|
Mon 02 Mar 2015 07:55:21 AM UTC, comment #9:
The Ctrl-C shortcut for copying in the editor was disabled directly after the settings dialog was closed since the related shortcut was activated for the terminal window without checking the current focus. Changeset http://hg.savannah.gnu.org/hgweb/octave/rev/b403780efe90 should fix this.
Rik, does Ctrl-C break a script for you when it is run from the editor?
|
Mon 02 Mar 2015 03:10:59 AM UTC, comment #8:
I reversed the cset in MXE octave that added the /B switch to the run command. That will make things work again, for the most part, in Windows.
|
Sun 01 Mar 2015 08:56:09 PM UTC, comment #7:
When calling the script from the terminal window, Ctrl-C is working but when running the script from the editor, Ctrl-C does not interrupt it. I have changed the mechanism for running a script from the editor in cset http://hg.savannah.gnu.org/hgweb/octave/rev/034bcac0b61c, now using Ffeval ().
Concerning the copying in the editor, this might be related to cset hg.savannah.gnu.org/hgweb/octave/rev/bd1369a2a651.
I will have a look at both csets within the next days.
|
Sun 01 Mar 2015 08:39:13 PM UTC, comment #6:
There is obviously something going on.
Test results:
Linux:
1) Break between system calls : WORKS
2) Break in Octave code : WORKS
Windows:
1) Break between system calls : FAILS
2) Break in Octave code : FAILS
According to Windows "start' documentation
If I change octave.bat to eliminate the '/B' switch then Ctrl+C goes back to working. Also, If I use the vbs script, the Ctrl+C processing works. The problem, as reported on the bug report about cmd windows, is that the vbs script fails to show the window if the Config Wizard needs to be run.
It seems like we need to figure out how to call the Raise Window function in Qt before the Config Wizard.
|
Sun 01 Mar 2015 07:36:47 PM UTC, comment #5:
Yeah I believe system calls were not interruptable, but in 3.8.2 it would break after the sleep, so if I pressed ctrl-c 5 seconds into the run, I would see 5 'ticks' only.
Running your example in linux, it does interrupt, with either global shortcut option.
Windows ignores it for both.
In both, the editor also seems to ignore the shortcut settings.
|
Sun 01 Mar 2015 07:15:04 PM UTC, comment #4:
Your test code works for me, but the call to sleep(1) will go out to a system library. I seem to remember a report about system calls being uninterruptible.
Could you try the attached tst_loop.m? It stays entirely within Octave using a cascaded for loop as a delay element. If Ctrl+C works (in Linux) with this file then I think we can start to narrow down what is wrong.
(file #33221)
|
Sun 01 Mar 2015 06:55:45 PM UTC, comment #3:
Maybe I am doing something wrong but in linux:
With and without Disable global shortcuts set.
Running script:
Pressing ctrl-C doesnt seem to do anything - after 10 seconds, I get 10 ticks.
|
Sun 01 Mar 2015 04:23:58 PM UTC, comment #2:
Is this the same as bug #37672 (GUI doesn't react to Ctrl+C)?
Also, what is the value in the Preferences->Shortcuts->Disable global shortcuts when terminal window has focus?
Are you running a version that has been compile after bug #44204 (Ctrl+C won't interrupt running scripts if Copy shortcut has been changed) was fixed?
For me, Linux seems to work, but Windows seems to ignore Ctrl+C.
|
Sun 01 Mar 2015 02:02:16 PM UTC, comment #1:
Is not working in Linux GUI either.
|
Sun 01 Mar 2015 01:34:13 PM UTC, original submission:
I'm running devel version of mxe-octave using c/s http://hg.savannah.gnu.org/hgweb/octave/rev/2f2220bfd379, so not sure yet when it was broken.
Ctrl-C to copy in any of the GUI windows, or interrupt a running script in the terminal does not appear to be working.
Copy via the menus still works, and Ctrl-V etc works ok.
Using the shortcut manager, I can set copy to something else - Ctrl-Y in this case, although I did also try others) and I can copy from the terminal ok, but the shortcut doesn't work in the editor (it does in other windows), and ctrl-c or ctrl-Y doesn't interrupt running code.
|