mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-05-20 01:01:53 +00:00
fix(cli): append newline to text-mode emitResult so zsh PROMPT_SP doesn't erase the line
Headless text mode wrote `resultMessage.result` without a trailing newline. In a TTY, zsh themes that use PROMPT_SP (powerlevel10k, agnoster, …) detect the missing `\n` and emit `\r\033[K` before drawing the next prompt, which wipes the final line off the screen. Pipe-captured output was unaffected, so the bug only surfaced for interactive shell users — most visibly in the background-agent flow where the drain-loop's final assistant message is the *only* stdout write in text mode. Append `\n` to both the success (stdout) and error (stderr) writes.
This commit is contained in:
parent
e3986311ef
commit
feadf052f7
1 changed files with 2 additions and 2 deletions
|
|
@ -67,9 +67,9 @@ export class JsonOutputAdapter
|
|||
|
||||
if (this.config.getOutputFormat() === 'text') {
|
||||
if (resultMessage.is_error) {
|
||||
process.stderr.write(`${resultMessage.error?.message || ''}`);
|
||||
process.stderr.write(`${resultMessage.error?.message || ''}\n`);
|
||||
} else {
|
||||
process.stdout.write(`${resultMessage.result}`);
|
||||
process.stdout.write(`${resultMessage.result}\n`);
|
||||
}
|
||||
} else {
|
||||
// Emit the entire messages array as JSON (includes all main agent + subagent messages)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue