Can't open files unless in ~/Documents/

I’m using version 2.1.4 installed using Flatpak.
The program doesn’t seem to be able access any file outside the “Documents” folder of the user’s home.

Here’s what I’ve tried:

  1. open a .tm file with texmacs from the file explorer, I get an error (“warning load error for /run/user/some/generated/path/file.tm, Success”), the error appears to be a form of “success”.
  2. launch texmacs, click on “open” in the menu: the file dialog box only shows the “Documents” folder within my home directory
  3. in the above dialog box, I enter the full path of a .tm file outside the “~/Documents” folder (but within a folder inside my home directory), I get an empty document
  4. I copied that .tm file I’m trying to open to the “~/Documents” folder. This file, I can open it using the menu etc, and it shows its expected content.

The file I’m trying to open is a valid .tm file (confirmed by the fact that it opens correctly when copied within the “Documents” folder), the folder it is in is within my home directory and I have full ownership and permissions on the file and all the directories above it (really it’s just a normal file in a normal directory that I created using normal means etc).

It seems that this is broken by the sandboxing system or something like that (the path in the error message on 1. isn’t the original path) - I don’t know much about how Flatpak works.

What is going on? Is there any way I could open the file wherever I want?

Note: I have other apps installed via Flatpak none of which have this issue.

As far as I know, it is a flatpak feature. For example, Wechat installed by flatpak can only access the “Downloads” folder.

1 Like

Is there anybody responsible for maintaining the flathub package? That would be great to set the sandbox permissions to allow for the native file chooser.

Hello there, welcome to the Forum :slight_smile:

The flatpak, unfortunately, has a few issues, the pdf export doesn’t work well, too. I’d recommend using another format for TeXmacs, like the distropackage, or the appimage.

If you want to use the flatpak, you can grant it access to the filesystem using Flatseal. It should then be able to open files anywhere on your computer.

About flatpak: It runs applications in a sandbox, i.e. each application sees its own storage, libraries, etc.
To be able to interact with the host computer, it needs permissions to see the host filesystem, this seems to be misconfigured in the flatpak for TeXmacs, but you can give the permission manually as described above.

1 Like

The PDF export of TeXmacs or Mogan relies on ghostscript (the gs commandline). In flatpak, for security reason, the flatpak-ed TeXmacs could not invoke the system gs command line. And also in the flakpak-ed TeXmacs, maxima plugin might not work well.

As a result, I suggest that one should not use the flatpak-ed TeXmacs.

1 Like

Thanks both for very useful answers: :slight_smile:

Let me add a point. This feature is very frequently to be used against untrusted softwares: think of the case that these softwares might contain some malicious codes to scan your personal files, analyze and upload to some server, and under sandboxes, those softwares are no longer accessible to your personal files.

1 Like