octave-maintainers
[Top][All Lists]
Advanced

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

Re: GUI starts up with terminal


From: Mike Miller
Subject: Re: GUI starts up with terminal
Date: Thu, 23 Aug 2012 19:56:01 -0400
User-agent: Mutt/1.5.21 (2010-09-15)

On Thu, Aug 23, 2012 at 05:22:42PM -0400, John W. Eaton wrote:
> I started looking at this.  It's not too hard to separate the command
> line option processing from the rest of the startup code, but that
> doesn't solve the whole problem.
> 
> I'd like to be able to run Octave from a terminal as always, except
> that now it will start the GUI by default.  That should not be too
> hard to do.  However, we need to know when we can avoid starting the
> GUI, for example when there is a filename specified on the command
> line or when I/O is coming from a pipe or redirected from a file:
> 
>  1. octave myfile.m
>  2. echo "x = 1" | octave
>  3. octave < myfile.m

Slight aside, after reading this, and not using 2 and 3 myself, I see
that octave does not support the "-" argument convention to indicate
stdin, it rather tries to load a file named "-". I think that's worth
handling also.

How about the arguably different case

  4. octave < /dev/null

which may be a somewhat reliable discriminator for running from a
launcher. I assume this would be treated like an empty script and Octave
will exit at EOF, that makes the most sense to me.

I wish there were a way to detect "started from a launcher panel" but I
think it's effectively the same as "octave < /dev/null".

How about testing argv[0] to see if it is "octave-gui" and treat it like
--force-gui? Then you have octave, which can be either CLI or GUI,
octave-cli, and octave-gui.

On Thu, Aug 23, 2012 at 06:13:48PM -0400, John W. Eaton wrote:
> On 23-Aug-2012, Daniel J Sebald wrote:
> 
> | Please add an option in the settings file because I quite often use 
> | octave in a minimalist fashion.
> 
> By the time Octave reads your .octaverc file, the GUI has already
> started.  It has to be that way, otherwise the output from commands
> that are executed in the octaverc file will not show up in the command
> window of the GUI.  If by "settings file" you mean the Qt settings
> file, then maybe there is a way to disable the gui there.  I'm not
> sure.  Would you like to work on that?

Sorry, but this sounds perverse :) Create a QApplication, in order to
create a QSettings, in order to read the Qt settings file, then an
option tells you not to use the GUI?

-- 
mike


reply via email to

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