bugGNU Octave - Bugs: bug #67032, MS Windows Octave GUI terminal...

 
 

bug #67032: MS Windows Octave GUI terminal widget should honor standard terminal escape sequences

Submitter:  Andy Potvin <afpotvin>
Submitted:  Thu 17 Apr 2025 03:04:35 PM UTC
   
 
Category:  Interpreter Severity:  2 - Minor
Priority:  5 - Normal Item Group:  Feature Request
Status:  None Assigned to:  None
Originator Name:  Andy Potvin Open/Closed:  * Open
Release:  * 9.4.0 Release: 
Operating System:  * Microsoft Windows Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Fri 18 Apr 2025 02:31:27 AM UTC, comment #6: 

Downgrading severity to "Minor" since there is a workaround for now.

Rik <rik5>
Group administrator
Thu 17 Apr 2025 10:04:34 PM UTC, comment #5: 

comment #4:

> Can I launch the editor/debugger even when I launch with --no-gui option?


No, the only GUI element that can be launched directly from the terminal version is the documentation browser with "doc topic".

> If so, how?  I try the command edit at the command line and it does nothing.


Try "help EDITOR" to see how to set the default editor for Octave which is used by the "edit" command.  This is the name of an external program, not the Octave built-in editor.  For example, on Windows it might be "notepad.exe" or some such.  Point it to a more capable editor that has syntax highlighting, etc.

Rik <rik5>
Group administrator
Thu 17 Apr 2025 06:19:06 PM UTC, comment #4: 

Yes, if you launch Octave --no-gui and it opens in PowerShell (in Windows), terminal escape sequences work.  And Rik confirms the same is true on a Linux terminal.

I'm talking about launching Octave --gui

In that case, terminal escape sequences are not obeyed if (as directed) you use "Windows Console Host".

But I just tried a couple things:

Test 1
=-=-=-=
As Dmitri suggested, I launched with --gui --experimental-terminal-widget and that created a different looking interface but still did not obey terminal escape sequences.

Test 2
=-=-=-=
Launched with just --gui but swapped to "Let Windows Decide" which terminal to use.  It immediately produces the warning:

warning: WARNING: You are using an incompatible Windows configuration!
Microsoft's new Terminal App is not compatible with Octave.
Please follow the instructions on the following page and set the default terminal to "Windows Console Host":
https://octave.discourse.group/t/4981/
warning: called from
 C:\PROGRA~1\GNUOCT~1\OCTAVE~1.0\mingw64\share\octave\site\m\startup/octaverc at line 27 column 5

but it still creates the Octave GUI, and it seems to work ok.  I can also access/open the editor/debugger.

And ... THAT Octave obeys terminal escape sequences!  Cool.  So, I guess I can just ignore the whining/warning.  It is a bit weird though.  It creates an Octave GUI, but it also creates a gnu.octave.9.4.0 tab in my PowerShell and the Octave GUI and PowerShell tab echo/mirror each other.


Final related question:
=-=-=-=-=-=-=-=-=-=-=-=
Can I launch the editor/debugger even when I launch with --no-gui option?  If so, how?  I try the command
edit
at the command line and it does nothing.







Andy Potvin <afpotvin>
Thu 17 Apr 2025 05:34:19 PM UTC, comment #3: 

It also works in gui in both linux and mac. It also works in the experimental gui windows on both linux and mac. It is quite possible it will work in this terminal on Windows as well, but I do not have Win computer readily available to check.

If it works there, we can mark this bug as "work in progress".

Dmitri.
--

Dmitri A. Sergatskov <dasergatskov>
Thu 17 Apr 2025 05:17:02 PM UTC, comment #2: 

I verify that using an escape sequence on a Linux terminal works.  Changing Operating system to MS Windows and re-titling report.

Is this an Octave issue or an issue with the underlying terminal in Windows?  From the discussion on Discourse, it seems that this is not present in all versions of PowerShell which makes me think it is not Octave, but the terminal which is the problem.

Rik <rik5>
Group administrator
Thu 17 Apr 2025 03:43:15 PM UTC, comment #1: 

Why OS selected as "Any" while it is a Windows-only problem?

Can you start octave on Windows as "octave --gui --experimental-terminal-widget" and see if it works there?

Dmitri.
--

Dmitri A. Sergatskov <dasergatskov>
Thu 17 Apr 2025 03:04:35 PM UTC, original submission:  

What would it take to have the Octave GUI (and standalone CLI) obey standard terminal escape sequences?  AFAIK, MATLAB does not do this either, but I'm wondering why.

Specifically, I suggest Octave obey sequences such as those found here:
https://gist.github.com/fnky/458719343aabd01cfb17a3a4f7296797

See also
https://octave.discourse.group/t/using-terminal-escape-characters-to-colorize-octave-output/6393/5

Note that I can run the Octave CLI in a Windows 11 24H2 PowerShell (7.5.0) and that will obey terminal escape sequences.  But then I can't simultaneously use the editor/debugger UI.  (Personally, I don't ever use the editor/debugger for editing, but do appreciate it as a debugging tool.)

Regards and thank you in advance for your response,
Andy

P.S. My request stems from the fact that I have project that runs long jobs/functions and spits out various progress/status to the command line, but there are certain progress/status that are more important than others, and I want to colorize those.


Andy Potvin <afpotvin>

 

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

Attach Files:
   
   
Comment:
   

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 rik5 (Posted a comment)
  • -email is unavailable- added by dasergatskov (Posted a comment)
  • -email is unavailable- added by afpotvin (Submitted the item)
  •  

    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 group members can vote.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2025-04-18 rik5 Severity3 - Normal 2 - Minor
    2025-04-17 rik5 Operating SystemAny Microsoft Windows
        SummaryMake Octave GUI obey standard terminal escape sequences MS Windows Octave GUI terminal widget should honor standard terminal escape sequences

    Back to the top

    Powered by Savane 3.15-e283.
    Corresponding source code