Cannot open the graphical text editor in the GUI in fedora maintained octave flatpak version 10.3.0. Error message "Cannot start custom editor emacs" Also, cannot override with custom editor in preferences. Error message will take the form "Cannot start custom editor <<insert editor>>" when something other than emacs is type in the Preferences > Custom editor ; and this regardless if the custom editor checkbox is checked. I have made sure to install emacs and tried updating my .octaverc with a known editor without success. The RPM version 10.2.0 or the Flathub 10.3.0 version work fine. Package info below: ================== ####@fedora:~$ flatpak info org.octave.Octave GNU Octave - Environnement de programmation interactif pour le calcul numérique ID: org.octave.Octave Ref: app/org.octave.Octave/x86_64/stable Arch: x86_64 Branch: stable Version: 10.3.0 License: GPL-3.0+ Origin: fedora Collection: Installation: system Installed: 605,7 Mo Runtime: org.fedoraproject.KDE6Sdk/x86_64/f43 Sdk: org.fedoraproject.KDE6Sdk/x86_64/f43 Commit: 4d5948d405c6dca87c820ff7ee95df179e8b2b35fb8da0805d8a0216806e344c Subject: Export org.octave.Octave Date: 2025-10-22 04:45:21 +0000 Alt-id: cad8d5c053a40bb9bb0cce25b8aa7f4dd92c7cc881728e950bc032f2494d9783 Reproducible: Always Steps to Reproduce: 1.open editor in octave --gui 2. 3. Actual Results: Error message "Cannot start custom editor emacs" Expected Results: The editor should open without error
Created attachment 2128110 [details] Screenshot
"xdg-open %f" will open files with your preferred application, or you could use "flatpak-spawn --host emacs +%l %f" to use an emacs installed on the host. (Specifying another application which is installed as a flatpak is a bit more complicated.) I don't see anything obvious in the flathub flatpak that would make using emacs work without an override though.
The way I see it, since we know the Octave built-in default is NEVER going to work in the Flatpak build, it should probably be changed to something less inherently broken. There are (at least) a couple of options that seem like they'd improve the Flatpak experience: 1. We could patch the compiled-in default from "emacs +%l %f" to something that _will_ work, like @yselkowi's "flatpak-spawn --host emacs +%l %f" or even "xdg-open %f". (in libgui/src/gui-preferences-global.cc at the 'global_custom_editor' setting.) 2. We could patch the compiled-in default to be the empty string, so that if the external editor is enabled (it defaults to disabled) and activated, Octave will (libgui/src/external-editor-interface.cc@external_editor_interface::external_editor) show a message box prompting "There is no custom editor configured yet. Do you want to open the preferences?" The down side to the first option is that it builds in a default that (either way) likely escapes the Flatpak sandboxing, which seems like a bad idea as a default to apply without user participation. (But, OTOH, the entire custom editor feature **is** still disabled by default.) The down side to the second option is, if the user does choose to open up the preferences and set a custom editor command, they'll have to know HOW to set one that _will_ work from inside the sandbox ("flatpak-spawn --host ..."), which seems like a pretty obscure bit of knowledge to expect users to divine without any sort of guidance from the application.
Whoops, sorry Yaakov, I @-ed you but didn't intend to set a needinfo.
(In reply to Yaakov Selkowitz from comment #2) > I don't see anything obvious in the flathub flatpak > that would make using emacs work without an override though. Same. And in fact, I installed the Flathub org.octave.Octave 10.3.0 and ran it. After enabling "Use custom file editor" in the preferences (leaving the command as the default "emacs +%l %f"), double-clicking a .m file in the File Browser gets me a dialog box saying "Could not start custom file editor emacs", same as Fedora's Flatpak.
Just trying to be extra clear. 1- I am trying to use the built-in Octave GUI editor not a custom one. 2- I have no issues with the Flathub version of the Octave flatpak. The Octave built-in editor in it works as expected. Hence there is something off with how Fedora packages it vs Flathub. My issues are limited to the Fedora flatpak of Octave where the built-in editor does not work, and the error message seems to disregard if the custom editor option is selected or not. I am not trying to get a custom editor to work with a flatpak.
Ohhh! That's completely different, yeah. Apologies for misunderstanding the issue. Hmm. The most likely reason for THAT would be if the Fedora Octave Flatpak isn't properly built with QScintilla, which Octave's built-in editor is based on. Then it would have no choice but to try using the external editor.
And, indeed, after installing Fedora's Octave Flatpak (which involved a 5-minute slog through downloading and installing the 5GB monolith texlive Flatpak as well, "joy"), I can confirm the same issue. As well as my theory as to the cause. Compare these results: % flatpak --system run org.octave.Octave --gui % flatpak enter org.octave.Octave /bin/sh sh-5.3$ ls /usr/lib64|grep -i scint [no results] To the Flathub Octave I have installed in my user space: % flatpak --user run org.octave.Octave --gui % flatpak enter org.octave.Octave /bin/sh sh-5.2$ ls /app/lib|grep -i scint libqscintilla2_qt5.so libqscintilla2_qt5.so.15 libqscintilla2_qt5.so.15.2 libqscintilla2_qt5.so.15.2.1 No QScintilla, no built-in editor.
(The Fedora 43 RPM-packaged Octave 10.2.0, for the record, is linked with Qt6 QScintilla. So, that's why its editor works.) % ldd /usr/lib64/octave/10.2.0/liboctgui.so|grep -i scint libqscintilla2_qt6.so.15 => /lib64/libqscintilla2_qt6.so.15 (0x00007fcb6ec00000)
@yselkowi Would it be sufficient to add qscintilla-qt6 to the "packages:" list in the Octave container.yml (which currently contains only "octave"), or does it need to be added to the flatpak-kde6-sdk runtime instead? (Or is there some third, better option for fixing this that I'm not even aware of?)