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

refactor: Improve terminal binary path detection #936

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

MiraiDevv
Copy link
Contributor

Replace alternative path detection with more robust binary path finding
Use which crate to locate terminal binaries
Extract binary path from desktop entry
Simplify symlink creation for x-terminal-emulator

It is important to mention that:

I will still send the PR regarding this in the cosmic-files repository
the functionality is not 100% complete, in developer mode, when we open cosmic-settings and cosmic-files and I change the terminal and try to click on open terminal in cosmic-files, cosmic files will open the terminal that was already selected, so if I am in cosmic-terminal when I open it and switch to warp and click on open in terminal it will open the old terminal and not warp (which was selected) so we still need to implement some function for cosmic-files to get the changes in real time from the cosmic-settings terminal change
but if you close cosmic files and hit cargo run again, it opens the correct terminal (which would be warp).

continuation and correction of the PR #935

Implement terminal app detection and selection functionality:
- Scan desktop entries for terminal emulators
- Add support for selecting default terminal application
- Retrieve current default terminal using XDG mime associations
- Enable terminal category in dropdown selection
Extend terminal application default selection to:
- Update MIME type associations
- Set system-wide terminal alternatives
- Persist configuration changes
- Trigger desktop database update
- Replace alternative path detection with more robust binary path finding
- Use `which` crate to locate terminal binaries
- Extract binary path from desktop entry
- Simplify symlink creation for x-terminal-emulator
@mmstick
Copy link
Member

mmstick commented Feb 1, 2025

It would be better to use a standard mechanism for this. x-terminal-emulator is specific to Debian/Ubuntu. There is currently a proposal for extending the xdg specs to add a default terminal spec. This is probably what we will do. https://github.com/Vladimir-csp/xdg-terminal-exec

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

Successfully merging this pull request may close these issues.

2 participants