mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 22:42:25 -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<()> {
|
pub fn relaunch_in_terminal() -> Result<()> {
|
||||||
let current_exe = std::env::current_exe().context("Failed to get current executable path")?;
|
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 = [
|
let terminals = [
|
||||||
("x-terminal-emulator", vec!["-e"]),
|
// commonly used for riced systems
|
||||||
("gnome-terminal", vec!["--"]),
|
|
||||||
("konsole", vec!["-e"]),
|
|
||||||
("xfce4-terminal", vec!["-e"]),
|
|
||||||
("alacritty", vec!["-e"]),
|
("alacritty", vec!["-e"]),
|
||||||
("kitty", vec![]),
|
("kitty", vec![]),
|
||||||
|
// minimalistic terminals for constrained systems
|
||||||
("foot", vec![]),
|
("foot", vec![]),
|
||||||
("urxvt", vec!["-e"]),
|
("urxvt", vec!["-e"]),
|
||||||
("xterm", 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 {
|
for (terminal_cmd, args) in &terminals {
|
||||||
|
|
Loading…
Reference in a new issue