mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 14:32:22 -04:00
Try unix terminals in roughly most specific to least specific. (#4177)
This commit is contained in:
parent
1ca31413f7
commit
3d6b4761e4
1 changed files with 11 additions and 5 deletions
|
@ -9,17 +9,23 @@ use anyhow::Result;
|
|||
pub fn relaunch_in_terminal() -> Result<()> {
|
||||
let current_exe = std::env::current_exe().context("Failed to get current executable path")?;
|
||||
|
||||
// Try terminals in order of preference
|
||||
// Try terminals in roughly most specific to least specific.
|
||||
// First, try commonly used terminals for riced systems.
|
||||
// Second, try the minimalist/compatibility terminals.
|
||||
// Finally, try terminals usually installed by default.
|
||||
let terminals = [
|
||||
("x-terminal-emulator", vec!["-e"]),
|
||||
("gnome-terminal", vec!["--"]),
|
||||
("konsole", vec!["-e"]),
|
||||
("xfce4-terminal", vec!["-e"]),
|
||||
// commonly used for riced systems
|
||||
("alacritty", vec!["-e"]),
|
||||
("kitty", vec![]),
|
||||
// minimalistic terminals for constrained systems
|
||||
("foot", vec![]),
|
||||
("urxvt", vec!["-e"]),
|
||||
("xterm", vec!["-e"]),
|
||||
("x-terminal-emulator", vec!["-e"]),
|
||||
// default installs for the most common distros
|
||||
("xfce4-terminal", vec!["-e"]),
|
||||
("gnome-terminal", vec!["--"]),
|
||||
("konsole", vec!["-e"]),
|
||||
];
|
||||
|
||||
for (terminal_cmd, args) in &terminals {
|
||||
|
|
Loading…
Reference in a new issue