wezterm fixes

This commit is contained in:
crschnick
2025-10-24 15:48:36 +00:00
parent b172dba16d
commit c3e1a28ba3

View File

@@ -104,12 +104,12 @@ public interface WezTerminalType extends ExternalTerminalType, TrackableTerminal
@Override
public void launch(TerminalLaunchConfiguration configuration) throws Exception {
boolean runGui = true;
var flatpak = FlatpakCache.getApp("org.wezfurlong.wezterm");
if (configuration.isPreferTabs()) {
CommandBuilder base;
if (CommandSupport.isInLocalPath("wezterm")) {
base = CommandBuilder.of().addFile("wezterm");
} else {
var flatpak = FlatpakCache.getApp("org.wezfurlong.wezterm");
if (flatpak.isPresent()) {
base = CommandBuilder.of().add("flatpak", "run").addQuoted("org.wezfurlong.wezterm");
} else {
@@ -117,7 +117,6 @@ public interface WezTerminalType extends ExternalTerminalType, TrackableTerminal
}
}
runGui = !LocalShell.getShell()
.command(CommandBuilder.of()
.add(base)
@@ -127,8 +126,18 @@ public interface WezTerminalType extends ExternalTerminalType, TrackableTerminal
}
if (runGui) {
CommandBuilder base;
if (CommandSupport.isInLocalPath("wezterm-gui")) {
base = CommandBuilder.of().addFile("wezterm-gui");
} else {
if (flatpak.isPresent()) {
base = CommandBuilder.of().add("flatpak", "run").addQuoted("org.wezfurlong.wezterm");
} else {
base = CommandBuilder.of().addFile("wezterm-gui");
}
}
ExternalApplicationHelper.startAsync(
CommandBuilder.of().addFile("wezterm-gui").add("start").addFile(configuration.getScriptFile()));
CommandBuilder.of().add(base).add("start").addFile(configuration.getScriptFile()));
}
}