octave startup directory?

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

octave startup directory?

jathan
i want octave (v4.2.1 x86_64 linux) to launch with in the current directory.  

when i launch octave from the terminal command line with the "--no-gui"
option, it defaults to starting the session with a working directory of
/home/$USER.  GUI session re-loads previous session & working directory, and
i would like to retain that behavior while terminal sessions start in the
local directory.

it's not clear what I should put in octaverc or ~/.octaverc (currently does
not exist) to induce this behavior and think this is probably set by
environmental variables.  any help or advice?  thanks



--
Sent from: http://octave.1599824.n4.nabble.com/Octave-General-f1599825.html


Reply | Threaded
Open this post in threaded view
|

Re: octave startup directory?

Mike Miller-4
On Mon, Sep 10, 2018 at 14:08:26 -0500, jathan wrote:
> when i launch octave from the terminal command line with the "--no-gui"
> option, it defaults to starting the session with a working directory of
> /home/$USER.  GUI session re-loads previous session & working directory, and
> i would like to retain that behavior while terminal sessions start in the
> local directory.

Yes, this seems like a clear bug that should be fixed. Can you please
file a bug report at

  https://savannah.gnu.org/bugs/?func=additem&group=octave

> it's not clear what I should put in octaverc or ~/.octaverc (currently does
> not exist) to induce this behavior and think this is probably set by
> environmental variables.  any help or advice?  thanks

If you don't intend to do any plotting at all when you run Octave in the
terminal, you can use octave-cli instead of octave.

Otherwise, the only workaround is to not set that preference in the GUI.

--
mike



signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: octave startup directory?

Torsten-3
On 10.09.2018 21:36, Mike Miller wrote:

> On Mon, Sep 10, 2018 at 14:08:26 -0500, jathan wrote:
>> when i launch octave from the terminal command line with the "--no-gui"
>> option, it defaults to starting the session with a working directory of
>> /home/$USER.  GUI session re-loads previous session & working directory, and
>> i would like to retain that behavior while terminal sessions start in the
>> local directory.
>
> Yes, this seems like a clear bug that should be fixed. Can you please
> file a bug report at
>
>   https://savannah.gnu.org/bugs/?func=additem&group=octave
>
>> it's not clear what I should put in octaverc or ~/.octaverc (currently does
>> not exist) to induce this behavior and think this is probably set by
>> environmental variables.  any help or advice?  thanks
>
> If you don't intend to do any plotting at all when you run Octave in the
> terminal, you can use octave-cli instead of octave.
>
> Otherwise, the only workaround is to not set that preference in the GUI.
>

I am not sure if we really have a bug here. Without .octaverc, the
current dev version starts in the local directory when launched as
terminal session. The behavior of the GUI depends on the preferences of
the file browser but IMHO, the octave directory is the same as if
launched as terminal session.

What would be the expected behavior?

Torsten



Reply | Threaded
Open this post in threaded view
|

Re: octave startup directory?

Mike Miller-4
On Tue, Sep 11, 2018 at 07:02:48 +0200, Torsten wrote:
> I am not sure if we really have a bug here. Without .octaverc, the
> current dev version starts in the local directory when launched as
> terminal session. The behavior of the GUI depends on the preferences of
> the file browser but IMHO, the octave directory is the same as if
> launched as terminal session.

No it doesn't. If the startup directory option is set in the GUI, and
the user then runs terminal mode octave (not octave-cli), the
interpreter changes to the startup directory of the GUI. That seems like
a bug to me, because it's unexpected and there is no way to configure it
or check it when the GUI is not running.

--
mike



signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: octave startup directory?

Torsten-3
On 11.09.2018 19:31, Mike Miller wrote:

> On Tue, Sep 11, 2018 at 07:02:48 +0200, Torsten wrote:
>> I am not sure if we really have a bug here. Without .octaverc, the
>> current dev version starts in the local directory when launched as
>> terminal session. The behavior of the GUI depends on the preferences of
>> the file browser but IMHO, the octave directory is the same as if
>> launched as terminal session.
>
> No it doesn't. If the startup directory option is set in the GUI, and
> the user then runs terminal mode octave (not octave-cli), the
> interpreter changes to the startup directory of the GUI. That seems like
> a bug to me, because it's unexpected and there is no way to configure it
> or check it when the GUI is not running.

Even if I set the startup directory and start octave with "--no-gui" (no
.octaverc) the octave directory is set to the current one, ignoring the
startup dir. In gui mode, the startup dir in the preferences defines the
initial directory for the the file browser. The octave directory still
is the current one or the one set in .octaverc.

Torsten



Reply | Threaded
Open this post in threaded view
|

Re: octave startup directory?

Mike Miller-4
On Tue, Sep 11, 2018 at 20:12:19 +0200, Torsten wrote:
> Even if I set the startup directory and start octave with "--no-gui" (no
> .octaverc) the octave directory is set to the current one, ignoring the
> startup dir.

That's not the behavior I see, with both stable and dev. The interpreter
starts in the GUI startup directory. Example:

    $ grep octave_startup_dir ~/.config/octave/qt-settings
    octave_startup_dir=/home
    $ pwd
    /tmp
    $ octave-5.0.0 -q --norc --no-gui
    octave:1> pwd
    ans = /home
    octave:2>

--
mike



signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

octave startup directory?

Torsten-3
On 11.09.2018 20:24, Mike Miller wrote:

> On Tue, Sep 11, 2018 at 20:12:19 +0200, Torsten wrote:
>> Even if I set the startup directory and start octave with "--no-gui" (no
>> .octaverc) the octave directory is set to the current one, ignoring the
>> startup dir.
>
> That's not the behavior I see, with both stable and dev. The interpreter
> starts in the GUI startup directory. Example:
>
>     $ grep octave_startup_dir ~/.config/octave/qt-settings
>     octave_startup_dir=/home
>     $ pwd
>     /tmp
>     $ octave-5.0.0 -q --norc --no-gui
>     octave:1> pwd
>     ans = /home
>     octave:2>

Okay, my fault, same behavior here. I was thinking of the startup dir
for the file browser and have missed the startup dir for octave in the
"General" tab.

Torsten



Reply | Threaded
Open this post in threaded view
|

Re: octave startup directory?

Torsten-3
On 11.09.2018 21:41, Torsten wrote:

> On 11.09.2018 20:24, Mike Miller wrote:
>> On Tue, Sep 11, 2018 at 20:12:19 +0200, Torsten wrote:
>>> Even if I set the startup directory and start octave with "--no-gui" (no
>>> .octaverc) the octave directory is set to the current one, ignoring the
>>> startup dir.
>>
>> That's not the behavior I see, with both stable and dev. The interpreter
>> starts in the GUI startup directory. Example:
>>
>>     $ grep octave_startup_dir ~/.config/octave/qt-settings
>>     octave_startup_dir=/home
>>     $ pwd
>>     /tmp
>>     $ octave-5.0.0 -q --norc --no-gui
>>     octave:1> pwd
>>     ans = /home
>>     octave:2>
>
> Okay, my fault, same behavior here. I was thinking of the startup dir
> for the file browser and have missed the startup dir for octave in the
> "General" tab.
>

Changeset http://hg.savannah.gnu.org/hgweb/octave/rev/eba6d823cf62
prevents octave from using the preferences for the startup dir from
qt-settings when in terminal mode.

Torsten



Reply | Threaded
Open this post in threaded view
|

Re: octave startup directory?

jathan
This post was updated on .
Thanks Torsten and Mike.
This issue appears to have more subtlety than I imagined and I appreciate
it. I did not know "octave-cli" behaved differently than octave and was
naively calling "octave --no-gui" since that's how i was accustomed to
calling m*tlab cli.

I aliased "octave-cli" to "octave", and "octave" to "octave-gui" to run as i
need them and this works fine for me.





--
Sent from: http://octave.1599824.n4.nabble.com/Octave-General-f1599825.html