Skip to content

Commit

Permalink
fixed bug where bazel runs with curses when using the old sync view (#…
Browse files Browse the repository at this point in the history
…7139)

The old sync view does not use a pty based terminal and cannot handle bazel output correctly when it runs with curses.
  • Loading branch information
LeFrosch authored Dec 7, 2024
1 parent dc05380 commit 0fb3f81
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,12 @@ class BazelExecService(private val project: Project) : Disposable {
}

private suspend fun execute(ctx: BlazeContext, cmdBuilder: BlazeCommand.Builder): Int {
val cmd = cmdBuilder.apply { addBlazeFlags("--curses=yes") }.build()
// the old sync view does not use a PTY based terminal
if (BuildViewMigration.present(ctx)) {
cmdBuilder.addBlazeFlags("--curses=yes")
}

val cmd = cmdBuilder.build()
val root = cmd.effectiveWorkspaceRoot.orElseGet { WorkspaceRoot.fromProject(project).path() }
val size = BuildViewScope.of(ctx)?.consoleSize ?: PtyConsoleView.DEFAULT_SIZE

Expand Down Expand Up @@ -182,5 +187,4 @@ class BazelExecService(private val project: Project) : Disposable {
}
}
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,10 @@ void println(PrintOutput output) {
}

private void println(String text, OutputType outputType) {
if (outputType == OutputType.PROCESS) {
text = text.stripTrailing();
}

ansiEscapeDecoder.escapeText(
text,
outputType == OutputType.ERROR ? ProcessOutputTypes.STDERR : ProcessOutputTypes.STDOUT,
Expand Down

0 comments on commit 0fb3f81

Please sign in to comment.