Add mac terminals

This commit is contained in:
crschnick 2023-07-15 17:49:48 +00:00
parent e73c16892c
commit e804951763

View file

@ -341,6 +341,40 @@ public interface ExternalTerminalType extends PrefsChoiceValue {
ExternalTerminalType TABBY_MAC_OS = new TabbyMacOsType(); ExternalTerminalType TABBY_MAC_OS = new TabbyMacOsType();
ExternalTerminalType ALACRITTY_MACOS = new MacOsType("app.alacrittyMacOs", "Alacritty") {
@Override
public void launch(String name, String file, boolean elevated) throws Exception {
try (ShellControl pc = LocalStore.getShell()) {
pc.command(String.format(
"""
%s/Contents/MacOS/alacritty -t "%s" -e %s
""",
getApplicationPath().orElseThrow(),
name,
pc.getShellDialect().fileArgument(file)))
.execute();
}
}
};
ExternalTerminalType KITTY_MACOS = new MacOsType("app.kittyMacOs", "Kitty") {
@Override
public void launch(String name, String file, boolean elevated) throws Exception {
try (ShellControl pc = LocalStore.getShell()) {
pc.command(String.format(
"""
%s/Contents/MacOS/kitty -T "%s" %s
""",
getApplicationPath().orElseThrow(),
name,
pc.getShellDialect().fileArgument(file)))
.execute();
}
}
};
ExternalTerminalType CUSTOM = new CustomType(); ExternalTerminalType CUSTOM = new CustomType();
List<ExternalTerminalType> ALL = Stream.of( List<ExternalTerminalType> ALL = Stream.of(
@ -362,6 +396,8 @@ public interface ExternalTerminalType extends PrefsChoiceValue {
TILDA, TILDA,
ITERM2, ITERM2,
TABBY_MAC_OS, TABBY_MAC_OS,
ALACRITTY_MACOS,
KITTY_MACOS,
WARP, WARP,
MACOS_TERMINAL, MACOS_TERMINAL,
CUSTOM) CUSTOM)
@ -488,40 +524,6 @@ public interface ExternalTerminalType extends PrefsChoiceValue {
} }
} }
ExternalTerminalType ALACRITTY_MACOS = new MacOsType("app.alacrittyMacOs", "Alacritty") {
@Override
public void launch(String name, String file, boolean elevated) throws Exception {
try (ShellControl pc = LocalStore.getShell()) {
pc.command(String.format(
"""
%s/Contents/MacOS/alacritty -t "%s" -e %s
""",
getApplicationPath().orElseThrow(),
name,
pc.getShellDialect().fileArgument(file)))
.execute();
}
}
};
ExternalTerminalType KITTY_MACOS = new MacOsType("app.kittyMacOs", "Kitty") {
@Override
public void launch(String name, String file, boolean elevated) throws Exception {
try (ShellControl pc = LocalStore.getShell()) {
pc.command(String.format(
"""
%s/Contents/MacOS/kitty -T "%s" %s
""",
getApplicationPath().orElseThrow(),
name,
pc.getShellDialect().fileArgument(file)))
.execute();
}
}
};
class WarpType extends ExternalApplicationType.MacApplication implements ExternalTerminalType { class WarpType extends ExternalApplicationType.MacApplication implements ExternalTerminalType {
public WarpType() { public WarpType() {