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

Open config file menu entry opens the file with an external program #20

Open
NicolasCARPi opened this issue Jul 31, 2024 · 6 comments
Open
Labels
feature New feature

Comments

@NicolasCARPi
Copy link
Contributor

Hello,

When clicking "Open config file" from the Settings menu, it uses open_with_external_program(), which uses xdg-open which opens it in Firefox on my system.

I would have expected it to be opened in the text editor, no?

@Bzero
Copy link
Owner

Bzero commented Jul 31, 2024

Hi,

I would have expected it to be opened in the text editor, no?

Yes, that's indeed the intention. I suspect this is an issue with your xdg-mime and/or desktop environment configuration which defaults to firefox for plaintext files instead of a text editor.

I am aware that the implementation of open_with_external_program is not ideal since we generally lack knowledge of the environment typstwriter is running in. If there is a more reliable way to open a file in the default application on all the different operating systems and desktop environments, I would be happy to change it.

@NicolasCARPi
Copy link
Contributor Author

Oh sorry when I meant "text editor" I was thinking of typstwriter itself. BTW, you could use $EDITOR maybe to call the external editor? But that might still not work very well, for instance on my system $EDITOR is vim, but it needs to be called using urxvt...

@Bzero
Copy link
Owner

Bzero commented Aug 2, 2024

Oh, I see. The config file could of course be opened with typstwriter itself, however I am not sure if that has any advantages over opening it in an external text editor. Actually this would maybe raise the expectation of the new config immediately taking effect which typstwriter is not capable of as of now without restarting.

@NicolasCARPi
Copy link
Contributor Author

NicolasCARPi commented Aug 2, 2024

I'd say opening the config file of the current text editor in the same current text editor seems reasonable. At least that's what I was expecting, and it might be easier to have this approach instead of trying to use xdg-open, as we've seen it is not foolproof.

If live-reloading is difficult to achieve, it is totally fine to simply show a warning that a restart of the application is necessary to take these settings into account.

@Bzero
Copy link
Owner

Bzero commented Aug 11, 2024

I would be fine with opening the config file in the internal editor if we add these extra warnings/notes. This would require some more work though and it might be favorable to add a proper GUI settings widget instead.

@Bzero Bzero added the feature New feature label Aug 11, 2024
@NicolasCARPi
Copy link
Contributor Author

Well, it's your decision. I was merely suggesting this. I don't think it's really important TBH, as we expect users to be able to edit a text file by themselves anyway. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature
Projects
None yet
Development

No branches or pull requests

2 participants