1

I am running GNU Octave from flatpak and I have an issue with the edit command. In Octave's CLI when I run

edit file.m

I got the following issue:

sh: vim: command not found

I have the following set in my octaverc configuration file (from GNU Octave Wiki: vim):

EDITOR('vim > /dev/tty 2>&1 < /dev/tty %s')

vim is installed on my system. I don't have any error if I replace vim by nano in the previous command.

I wonder if the problem isn't that I'm using flatpak.

3 Answers3

1

Flatpak app can run only executables provided by it and its runtime (org.kde.Sdk/x86_64/5.14 in case of org.octave.Octave). Nano is available in org.kde.Sdk. Neither Vim nor Emacs are available there.

You can run host program from Flatpak container using flatpak-spawn --host. See How to allow GUI application in flatpak to run CLI tool?.

I run Octave in terminal and after some trial-and-error I've found working configuration:

edit mode sync
edit home .
EDITOR('flatpak-spawn --host --env=TERM=linux /usr/bin/vim > /dev/tty 2>&1 < /dev/tty %s')
Anton Leontiev
  • 775
  • 1
  • 5
  • 11
  • This totally makes sense but not working on my system. I got the following error: `Can't find bus: Error spawning command line “dbus-launch --autolaunch=83dc97dce7a847508eaa5ac387352f59 --binary-syntax --close-stderr”: Child process exited with code 1` –  Jun 30 '20 at 14:07
0

Do you have vim installed?

If not try sudo apt install vim -y (for Debian/Ubuntu etc.)

z3rone
  • 62
  • 9
0

the problem is probably that the PATH is not set or doesn't include the path in which vim is installed in.

You should open a terminal and type which vim, and you should have a path like /usr/bin/vim or something similar depending on your distribution.

And instead of just adding vim, you should have EDITOR('/usr/bin/vim > /dev/tty 2>&1 < /dev/tty %s')

  • Not it's not working. If it was a `PATH` issue, `nano` wouldn't work either. –  Jun 25 '20 at 07:49
  • It depends nano might not be in the same path, I don't know how your tools are installed nor where they are. `vim: command not found` looks really much like a PATH error to me – Pierre-Alain TORET Jun 25 '20 at 07:52
  • `vm` and `nano` are both in the same directory `/usr/bin`. Both have been installed by my package manager. `EDITOR('/usr/bin/vim > /dev/tty 2>&1 < /dev/tty %s')` don't work while `EDITOR('/usr/bin/nano > /dev/tty 2>&1 < /dev/tty %s')` works. –  Jun 25 '20 at 11:35