fix(ai-services): Prevent TTY errors during AI streaming output
The function used terminal manipulation functions (like , ) for the CLI streaming progress indicator. This caused errors when Task Master commands involving AI streaming were run in non-interactive terminals (e.g., via output redirection, some CI environments, or integrated terminals). This commit adds a check for to the condition that controls the display of the CLI progress indicator, ensuring these functions are only called when standard output is a fully interactive TTY.
This commit is contained in:
@@ -1038,8 +1038,8 @@ async function _handleAnthropicStream(
|
||||
const isSilent =
|
||||
silentMode || (typeof silentMode === 'undefined' && isSilentMode());
|
||||
|
||||
// Only show CLI indicators if in cliMode AND not in silent mode
|
||||
const showCLIOutput = cliMode && !isSilent;
|
||||
// Only show CLI indicators if in cliMode AND not in silent mode AND stdout is a TTY
|
||||
const showCLIOutput = cliMode && !isSilent && process.stdout.isTTY;
|
||||
|
||||
if (showCLIOutput) {
|
||||
loadingIndicator = startLoadingIndicator(
|
||||
|
||||
Reference in New Issue
Block a user