octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Ctrl-Z not working correctly with --no-gui option


From: Daniel J Sebald
Subject: Re: Ctrl-Z not working correctly with --no-gui option
Date: Wed, 30 Oct 2013 22:33:28 -0500
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.24) Gecko/20111108 Fedora/3.1.16-1.fc14 Thunderbird/3.1.16

On 10/30/2013 10:32 AM, Rik wrote:
On 10/29/2013 11:09 PM, John W. Eaton wrote:
On 10/29/2013 06:03 PM, Rik wrote:
10/29/13

jwe,

When I use 'run-octave --no-gui' from a shell I get a CLI interface.
However, if I suspend the program with Ctrl-Z I get occasional printings of
the octave prompt while I am working in the shell.  This doesn't happen if
I use '--no-gui-libs'.

I think the strange behavior was due to a botched test in the main
program in main.in.cc that caused Octave to fork+exec instead of just
exec when not running the gui.  I fixed that problem in this
changeset:

   http://hg.savannah.gnu.org/hgweb/octave/rev/0b81d65d3c49

However, signals are still not working properly.  For example, try
starting Octave with --no-gui and then type Ctlr-Z.  I expect that it
won't respond.  Now type another character.  That will suspend
Octave.  If you resume it, then the character you previously typed
should be pending as input at the prompt.

I'm mostly seeing this, but with one more oddity.  If I type 'run-octave
--no-gui' the prompt at the CLI is "octave".  Similarly if I use
'run-octave --no-gui-libs' the prompt is "octave".  But, if I add an
additional option for processing, then the prompt changes to "octave-gui"
or "octave-cli".  So, 'run-octave --no-gui -f' produces the the prompt
"octave-gui".  At first I thought this was mostly about what we were
putting in to the 0th argument for exec, but I think there might be more to
it.  If I use 'run-octave --no-gui' then Ctrl-Z behavior works.  If I add
extra arguments so that octave-gui is definitely invoked, then I see the
problem with Ctrl-Z detailed above.


If instead of calling

   main_thread.start ();

I just print "hello world", then the Qt event loop starts and the
program responds to Ctrl-Z, so perhaps the problem is happening
because Octave is running in a separate thread?

Based on the description of the QCoreApplication class, I checked in
one additional change so that if the GUI is not started, then we use
QCoreApplication instead of QApplication.  I think that's the right
thing to do, but if anyone knows for sure, please speak up.

Finally, since we don't really have the non-gui version of Octave
working with Qt-based widgets for things like uigetfile, maybe we
should just start octave-cli when --no-gui is specified?

Not uigetfile, but weren't the dialog boxes such as errordlg, warndlg, etc.
working from the command line as long as Qt was available?

No Qt if the GUI is not working. (But Java and ASCII-based might still be available.) The Qt-based errordlg, etc. go through the GUI interface because that is where it is convenient to throw up a dialog box and makes most sense in terms of user response and so on. To have another driver for Qt dialog boxes independent of the GUI is repetition in a way.

The errordlg, etc. behavior isn't the most robust from the Octave-core side of things. From what I'm remembering, Octave will request that a dialog box be made provided it knows the GUI is running, but it doesn't accept return info about whether that was successful. So rather than fall back on Java if there is no success, nothing happens. That isn't likely to be the case, but still not thorough. Hopefully that can be addressed in future versions.

Dan


reply via email to

[Prev in Thread] Current Thread [Next in Thread]