backport: 15.1.1

This commit is contained in:
FalsePattern 2024-06-06 13:15:27 +02:00
parent 2efe64c6c9
commit 882570b48c
Signed by: falsepattern
GPG key ID: E930CDEC50C50E23
3 changed files with 15 additions and 2 deletions

View file

@ -17,6 +17,13 @@ Changelog structure reference:
## [Unreleased] ## [Unreleased]
## [15.1.1]
### Fixed
- Project
- PTY emulation is now opt-in in run configurations
## [15.1.0] ## [15.1.0]
### Added ### Added

View file

@ -57,7 +57,7 @@ public abstract class ProfileStateBase<T extends ZigExecConfigBase<T>> extends C
// TODO remove this check once JetBrains implements colored terminal in the debugger // TODO remove this check once JetBrains implements colored terminal in the debugger
// https://youtrack.jetbrains.com/issue/CPP-11622/ANSI-color-codes-not-honored-in-Debug-Run-Configuration-output-window // https://youtrack.jetbrains.com/issue/CPP-11622/ANSI-color-codes-not-honored-in-Debug-Run-Configuration-output-window
val cli = debug ? new GeneralCommandLine() : new PtyCommandLine(); val cli = configuration.emulateTerminal() && !debug ? new PtyCommandLine() : new GeneralCommandLine();
cli.setExePath(zigExecutablePath.toString()); cli.setExePath(zigExecutablePath.toString());
workingDirectory.getPath().ifPresent(x -> cli.setWorkDirectory(x.toFile())); workingDirectory.getPath().ifPresent(x -> cli.setWorkDirectory(x.toFile()));
cli.setCharset(StandardCharsets.UTF_8); cli.setCharset(StandardCharsets.UTF_8);

View file

@ -38,6 +38,7 @@ import java.util.Optional;
@Getter @Getter
public abstract class ZigExecConfigBase<T extends ZigExecConfigBase<T>> extends LocatableConfigurationBase<ProfileStateBase<T>> { public abstract class ZigExecConfigBase<T extends ZigExecConfigBase<T>> extends LocatableConfigurationBase<ProfileStateBase<T>> {
private ZigConfigEditor.WorkDirectoryConfigurable workingDirectory = new ZigConfigEditor.WorkDirectoryConfigurable("workingDirectory"); private ZigConfigEditor.WorkDirectoryConfigurable workingDirectory = new ZigConfigEditor.WorkDirectoryConfigurable("workingDirectory");
private ZigConfigEditor.CheckboxConfigurable pty = new ZigConfigEditor.CheckboxConfigurable("pty", "Emulate Terminal", false);
public ZigExecConfigBase(@NotNull Project project, @NotNull ConfigurationFactory factory, @Nullable String name) { public ZigExecConfigBase(@NotNull Project project, @NotNull ConfigurationFactory factory, @Nullable String name) {
super(project, factory, name); super(project, factory, name);
workingDirectory.setPath(getProject().isDefault() ? null : Optional.ofNullable(ProjectUtil.guessProjectDir(getProject())) workingDirectory.setPath(getProject().isDefault() ? null : Optional.ofNullable(ProjectUtil.guessProjectDir(getProject()))
@ -64,10 +65,15 @@ public abstract class ZigExecConfigBase<T extends ZigExecConfigBase<T>> extends
public abstract List<String> buildCommandLineArgs(boolean debug) throws ExecutionException; public abstract List<String> buildCommandLineArgs(boolean debug) throws ExecutionException;
public boolean emulateTerminal() {
return pty.value;
}
@Override @Override
public T clone() { public T clone() {
val myClone = (ZigExecConfigBase<?>) super.clone(); val myClone = (ZigExecConfigBase<?>) super.clone();
myClone.workingDirectory = workingDirectory.clone(); myClone.workingDirectory = workingDirectory.clone();
myClone.pty = pty.clone();
return (T) myClone; return (T) myClone;
} }
@ -79,6 +85,6 @@ public abstract class ZigExecConfigBase<T extends ZigExecConfigBase<T>> extends
throws ExecutionException; throws ExecutionException;
public @NotNull List<ZigConfigEditor.@NotNull ZigConfigurable<?>> getConfigurables() { public @NotNull List<ZigConfigEditor.@NotNull ZigConfigurable<?>> getConfigurables() {
return List.of(workingDirectory); return List.of(workingDirectory, pty);
} }
} }