Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Double clicking scripts opens them in the default browser instead of the text editor regardless of the file extension or permissions #440

Open
JoaoDelille opened this issue Sep 4, 2024 · 0 comments
Milestone

Comments

@JoaoDelille
Copy link

Cosmic-files version:
Name : cosmic-files
Version : 0.1.0~^20240829gitd923efa
Release : 1.fc40
Architecture : x86_64
Size : 28 M
Source : cosmic-files-0.1.0~^20240829gitd923efa-1.fc40.src.rpm
Repository : @System
From repo : copr:copr.fedorainfracloud.org:ryanabx:cosmic-epoch
Summary : Libcosmic file manager

Issue/Bug description:
Double clicking on a script will open it in the default browser.
This does not depend on the file being marked as executable.
This does not happen with regular text files.
A file named "test.py" containing regular text opens in the text editor, however the same file will open in the default browser if it contains valid python code.

Steps to reproduce:
Create two files, the extension does not matter.
In one of them write regular text, in the other write valid python or shell code such as "from datetime import datetime" or "#!/bin/bash"
When double clicked the regular text file will open in the default text editor, but the code opens in the browser.

echo "from datetime import datetime" > file1
echo "lorem ipsum dolor sit amet" > file2

image

Expected behavior:
Both files open on the default text editor instead of the default browser

Other notes:
I am on fedora 40 workstation.
This is only partly reproducible with python scripts, a text file containing from datetime import datetime always opens in firefox, but a text file containing import numpy as np always opens in cosmic edit. Shell scripts always open in firefox presumably because they all begin with #!/bin/bash
Not sure about other languages because I have not tried them. Empty files also open in firefox

@WatchMkr WatchMkr added this to the alpha 3 milestone Sep 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Post-Current-Alpha ToDo
Development

No branches or pull requests

2 participants