Files remember default applications and open some kind of files with that application.
In the following example, text files should be opened with VS Code, which is selected as a default application to open text files.
Files does not remember default applications or open some kind of files with that application.
In the following example, text files are opened with Code, which is not selected as a default application to open text files.



In current master, using a .txt file for testing:
Looks like an unintended side-effect of some code cleanup in this area :-(
Strangely, it seems to work as expected using an image file (*.png)? Or a folder (except a bug using Terminal as the default seems to have reappeared)
Indeed, also I confirmed images, videos, html, and music files are opened with default applications correctly.
In my experience, none of the default app associations I have configured work with Files 4.1.1.
I have:
Qmmp as my default audio player
mpv as my default video player
Mirage as my default photo viewer
[just a few examples that I can name off of the top of my head]
And yet, mpv will always open audio files by default, rather than Qmmp. Yeah, it plays the audio absolutely fine, but this becomes a nuisance when opening another audio file... as it begins to open another mpv window while the existing audio is already playing
I'll install those and check whether the linked PR fixes the problem.
I can confirm the linked PR fixes @citrusui 's problem.
I am facing same issue. Images and text files not opening with default application. For images I only have Nomacs installed, it shows 'open with' dialog. But for text files, Sublime is set to default, but Files chooses GitKraken automatically.
A few issues still remain for me:
*Additionally, any default audio player / video player preference I have set is ignored. Even when I set the default Video app (audience) to open video files, mpv is chosen instead. I had initially thought that audio files were falling back to open in the default video player, but this is not the case. Even when I change my default video player AND audio player, mpv is still used
I will be downgrading to Files 4.0 again until another fix arrives :disappointed:
@citrusui The latest release (4.1.2) occurred before the fix was merged I am afraid so is currently only available by compiling the master source. Another release is due shortly however. If you have tested the master source then please re-open the issue.
Yep, can confirm Files 4.1.3 fixes all of my issues! Thank you.
file 4.1.3, i have issue with pdf. If i select open with okular instead of the default pdf reader, when i click on a pdf it still be opened with the native pdf
@francesco-taioli : For okular to become the default application, you have to go to the 'other application' submenu and select it there with 'set as default' ticked. This is not entirely obvious so maybe there is scope for a UX issue here,
I have checked that if you use the "Other Application" dialog then Okular can be set as default so I am not going to reopen this issue (which was about apps not permanently becoming default even if explicitly set as default).
@francesco-taioli : For okular to become the default application, you have to go to the 'other application' submenu and select it there with 'set as default' ticked. This is not entirely obvious so maybe there is scope for a UX issue here,
yep @jeremypw , i discovered this after some time. Anyway seems legit that if i go to System settings, applications and i select Okular as default app for pdf i should be able to open pdf with oKular without 'set as default ticket'... this is a minor issue, there are many other MORE important ( wifi with hp pc, hdmi audio ecc )
@francesco-taioli : There is no way to set the default app for pdfs in System Settings afaict. The setting for "Text Editor" is for plain text. I suppose System Settings/Applications/Default could be expanded to include more common mime types but there is a limit to how many can be included (and that should be raised as an issue against Switchboard).
Also check out https://github.com/elementary/files/issues/871
Most helpful comment
In current master, using a .txt file for testing: