Add separate UsePty flag for CmdObj

This decouples StreamOutput from whether a PTY is used. In most cases we just
want to see the output in the log window, but don't have to use a PTY, e.g. for
the bisect commands.

This has the implication that custom commands that are using "stream: true" no
longer use a PTY. In most cases that's probably a good thing, but we're going to
add a separate pty config for those who really wanted this.
This commit is contained in:
Stefan Haller 2025-04-30 11:45:45 +02:00
parent 8cf617b683
commit a199ed1396
2 changed files with 24 additions and 1 deletions

View file

@ -238,7 +238,13 @@ func (self *cmdObjRunner) runAndStreamAux(
var stderr bytes.Buffer
cmd.Stderr = io.MultiWriter(cmdWriter, &stderr)
handler, err := self.getCmdHandlerPty(cmd)
var handler *cmdHandler
var err error
if cmdObj.ShouldUsePty() {
handler, err = self.getCmdHandlerPty(cmd)
} else {
handler, err = self.getCmdHandlerNonPty(cmd)
}
if err != nil {
return err
}