bugGNU Octave - Bugs: bug #63857, editor window doesn't always grab...


bug #63857: editor window doesn't always grab focus after calling edit <function>

Submitter:  Nicholas Jankowski <nrjank>
Submitted:  Wed 01 Mar 2023 07:34:02 PM UTC
Category:  GUI Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Other
Status:  None Assigned to:  None
Originator Name:  Open/Closed:  * Open
Release:  * 8.0.90 Operating System:  * Microsoft Windows
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup

Mon 06 Mar 2023 08:57:10 PM UTC, comment #3: 

I can confirm this on windows and will try to find what behaves differently on windows.

Torsten Lilge <ttl>
Group Member
Mon 06 Mar 2023 07:39:55 PM UTC, comment #2: 

sorry if it wasn't clear but this report is specifically referring to behavior of the built in editor in the GUI.

Nicholas Jankowski <nrjank>
Group Member
Mon 06 Mar 2023 07:34:30 PM UTC, comment #1: 

Octave uses the EDITOR environment variable to determine which editor to use. However, you can override this by setting the "edit_command" variable in Octave to the path of your preferred editor.

For example, if you want to use the vi editor, you can add the following line to your Octave startup file (such as ~/.octaverc)
: edit_command="vi"

Wed 01 Mar 2023 07:34:02 PM UTC, original submission:  

tested on Windows 10 with Octave 8.0.91 (hg id: 82128f652585). compared with Linux, Octave 9.0.0 (hg id: cbeeb8b44c28) (don't have stable built right now to compare).

(1) with a docked (default location) editor window, typing edit or edit <function> changes focus to the Editor window. On linux, when a function is already open in the editor, edit <function> still switches focus back to the editor. On windows, focus switches if a new window is opened, but it doesn't switch if the function is already open (or if there are multiple files open in the editor, if it is already "on top").  it would be preferred for consistent focus-grabbing across platforms.

(2) with an undocked/floating editor window:
On linux, if no functions are open and the editor window has been closed. Typing edit brings up a new editor window with an <unnamed> function open, with focus. subsequent calls to edit or edit <function> will bring the window/tab into focus whether it's minimized, hidden behind other windows, etc., as expected. 

On Windows, with no functions open and the editor window closed, typing edit brings up a new editor window with an <unnamed> function open, with focus. Another call to edit will again bring
focus if it creates a new editor tab. But focus will not be given if the function is already open. Also, if the editor is minimized, the window seems to almost never be Restore'd at all.  HOWEVER, cursor focus seems to be given. the command line window cursor stops responding as if you switched focus, and typing will have seemingly no effect until manually restoring the editor window, and seeing all of the characters were being typed there.    I have also seen this occur without being minimized, where the editor window is behind the main octave window. edit <function> is typed, focus is not given, but typing puts text in the editor window. (in (1) above, when docked, I can't make typing focus issue occur)

Nicholas Jankowski <nrjank>
Group Member


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

Attach Files:

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by ttl (Posted a comment)
  • -email is unavailable- added by priyanshu (Posted a comment)
  • -email is unavailable- added by nrjank (Submitted the item)
  • -email is unavailable- added by nrjank

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only project members can vote.


    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2023-03-01 nrjank Carbon-Copy- Added ttl

    Back to the top

    Powered by Savane 3.12