Add support for powershell core terminal

This commit is contained in:
crschnick 2023-04-13 16:28:13 +00:00
parent 1e30ca595c
commit f777604573
3 changed files with 18 additions and 1 deletions

View file

@ -30,7 +30,21 @@ public interface ExternalTerminalType extends PrefsChoiceValue {
};
public static final ExternalTerminalType POWERSHELL =
new SimpleType("powershell", "powershell.exe", "PowerShell") {
new SimpleType("powershell", "powershell", "PowerShell") {
@Override
protected String toCommand(String name, String file) {
return "-ExecutionPolicy Bypass -Command cmd /C '" + file + "'";
}
@Override
public boolean isSelectable() {
return OsType.getLocal().equals(OsType.WINDOWS);
}
};
public static final ExternalTerminalType PWSH =
new SimpleType("pwsh", "pwsh", "PowerShell Core") {
@Override
protected String toCommand(String name, String file) {
@ -125,6 +139,7 @@ public interface ExternalTerminalType extends PrefsChoiceValue {
public static final List<ExternalTerminalType> ALL = Stream.of(
WINDOWS_TERMINAL,
PWSH,
POWERSHELL,
CMD,
KONSOLE,

View file

@ -90,5 +90,6 @@ customTerminalCommand=Custom terminal command
customTerminalCommandDescription=The command to use to open the custom terminal. The placeholder string $cmd will be replaced by the actual command when called. If you don't specify a placeholder command, the actual command will be appended.
cmd=cmd.exe
powershell=Powershell
pwsh=Powershell Core
windowsTerminal=Windows Terminal
gnomeTerminal=Gnome Terminal

1
dist/build.gradle vendored
View file

@ -42,6 +42,7 @@ if (rootProject.fullVersion) {
apply from: 'proguard.gradle'
apply from: 'jreleaser.gradle'
apply from: 'choco.gradle'
apply from: 'homebrew.gradle'
if (org.gradle.internal.os.OperatingSystem.current().isLinux()) {
apply from: 'linux_packages.gradle'