Skip to content

Conversation

@pandemicsyn
Copy link
Contributor

@pandemicsyn pandemicsyn commented Nov 17, 2025

Context

Right now if you use --json or do a --auto and redirect to a file, you end up with unexpected control chars in the nd-json or file.

Implementation

Screenshots

Sample:

❯ kilocode --auto --json "Say hi" | cat -v | head -n 5
^[]0;Kilo Code - tmp^G^[[2J^[[3J^[[H^[[?2004h{"timestamp":1,"source":"cli","id":"msg-1763415435555-3743","type":"welcome","content":"","metadata":{"welcomeOptions":{"clearScreen":false,"showInstructions":false,"instructions":[]}}}

^[[2K^[[1A^[[2K^[[G{"timestamp":1763415435573,"source":"extension","type":"say","say":"text","content":"Say hi"}

^[[2K^[[1A^[[2K^[[G{"timestamp":1763415435581,"source":"extension","type":"say","say":"api_req_started","metadata":{"apiProtocol":"openai"}}

/tmp 9s
❯ kilocode --auto "Say hi" > sample.txt && cat -v sample.txt | head -n 5
^[]0;Kilo Code - tmp^G^[[2J^[[3J^[[H^[[?2004h

 ⣿⡿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⢿⣿
 ⣿�M-^G�M-^@�M-^@�M-^@�M-^@�M-^@�M-^@�M-^@�M-^@�M-^@�M-^@�M-^@�M-^@�M-^@�M-^@�M-^@�M-^@⢸⣿     �M-^VM-^H�M-^VM-^H�M-^VM-^H�M-^VM-^H�M-^VM-^H   �M-^VM-

How to Test

Get in Touch

@changeset-bot
Copy link

changeset-bot bot commented Nov 17, 2025

⚠️ No Changeset found

Latest commit: 95abcf8

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@pandemicsyn pandemicsyn changed the title Fix handling of control characters in JSON output mode and when redir… Don't emit control characters in JSON output mode or when redirecting to non tty's Nov 17, 2025
@pandemicsyn pandemicsyn changed the title Don't emit control characters in JSON output mode or when redirecting to non tty's cli should not emit control characters in JSON output mode or when no tty Nov 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants