Try unix terminals in roughly most specific to least specific. (#4177)

This commit is contained in:
Kevin Nakamura 2025-07-07 08:44:39 +00:00 committed by GitHub
parent 1ca31413f7
commit 3d6b4761e4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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 {