bugGNU Octave - Bugs: bug #44368, Opening an Octave file via a...


bug #44368: Opening an Octave file via a desktop application does not open file on Octave editor

Submitted by:  Carnë Draug <carandraug>
Submitted on:  Wed 25 Feb 2015 03:50:29 PM UTC  
Category: GUISeverity: 3 - Normal
Priority: 5 - NormalItem Group: Feature Request
Status: NoneAssigned to: None
Originator Name: Open/Closed: Open
Release: devOperating System: GNU/Linux

Add a New Comment(Rich Markup)

You are not logged in

Please log in, so followups can be emailed to you.


Fri 05 Jun 2015 10:44:08 AM UTC, comment #5:

See patch on duplicated bug #44880

Carnë Draug <carandraug>
Project Member
Thu 26 Feb 2015 10:06:48 PM UTC, comment #4:

On my system, running octave --force-gui --persist --eval 'edit ""' will open the GUI on the text editor tab without throwing any error. Seems handy that edit() without any arguments opens a new instance of the text editor (this is not a feature of the GUI, on Octave 3.8 using another text editor, edit() without any arguments opened my editor with a new empty buffer.

Carnë Draug <carandraug>
Project Member
Thu 26 Feb 2015 07:31:16 PM UTC, comment #3:

I mean the default behavior of running Octave with no arguments,

  • no filenames - open Octave with the command window

The workaround of doing --eval "edit %1" breaks that behavior.

So I thought there would still be a need for a .desktop entry file for just running Octave as a program, not to edit a file, right?

I was thinking the .desktop file we have now would be the main one that would show up in the normal application menu, and a second .desktop file would be used for file associations and open the editor with the given file arguments. This would have the NoDisplay=true attribute set so it doesn't show up in menus and is only used for file type associations.

Or is there any way to reduce all of those options to a single .desktop file? Or did I miss something?

Mike Miller <mtmiller>
Project Administrator
Thu 26 Feb 2015 06:46:38 PM UTC, comment #2:

If there was an --editor option, the behaviour could be

  • no filenames - open GUI on the editor
  • single filenames - open that files
  • multiple filenames - open all those files

and there would be no need for two desktop entries.

I think the workaround mentioned already solves the first two cases.

The only thing is, what happens if the user has defined an editor on their octaverc ? I tried to do it, and it still opened the file on the Octave GUI editor which is weird for me. Shouldn't my editor preferences be kept, specially since I am setting them myself and not relying on defaulting to emacs?

Carnë Draug <carandraug>
Project Member
Thu 26 Feb 2015 05:52:49 AM UTC, comment #1:

I think this would probably best be done with multiple .desktop entries. On my Debian system I have /usr/share/applications/org.gnome.Software.desktop and /usr/share/applications/gnome-software-local-file.desktop. These both run the same program, but one without a file argument and one with. And only the latter has a MIME type listed to register a file association.

And like you said, we could either use the current workaround as the command line to open a file in the editor or make a new command-line option to edit a file.

Mike Miller <mtmiller>
Project Administrator
Wed 25 Feb 2015 03:50:29 PM UTC, original submission:

During installation, Octave "registers" as being able to handle Octave and Matlab files.

This means that double click on a file with MIME type text/x-octave and text/x-matlab will open on Octave session. However, this will only execute the file not open it on the Octave GUI editor which is probably what a user wants. With the octave program now being both a language and an IDE, an "--edit" option would be useful to do this.

Bug #42603 (GUI: allow opening an m-file in the editor of a running instance) is related to this issue. They solve the problem related on this bug by having desktop applications opening files with 'octave --force-gui --persist --eval "edit %1"'

The same workaround can be used by having the following line on http://hg.savannah.gnu.org/hgweb/octave/file/bf511802add7/etc/icons/octave.desktop.in

Or should we really get an --editor flag that could maybe even accept multiple files?

Carnë Draug <carandraug>
Project Member


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):

No files currently attached


Depends on the following items: None found

   bug dependencies.


Carbon-Copy List
  • -unavailable- added by mtmiller (Posted a comment)
  • -unavailable- added by carandraug (Submitted the item)

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.


    Please enter the title of George Orwell's famous dystopian book (it's a date):



    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 27 Sep 2016 10:18:49 PM UTCmtmillerDependencies-=>bugs #49054 is dependent
    Fri 05 Jun 2015 10:43:33 AM UTCcarandraugDependencies-=>bugs #44880 is dependent
    Thu 26 Feb 2015 05:52:49 AM UTCmtmillerItem GroupNone=>Feature Request

    Back to the top

    Powered by Savane 3.1-cleanup1