davsclaus opened a new pull request, #23510:
URL: https://github.com/apache/camel/pull/23510
## Summary
- Replace JLine `TerminalBuilder` with `COLUMNS` env var / `stty size` for
terminal width detection in `TerminalWidthHelper`
- Fixes escape sequence leak (DA1 and CPR responses) into shell output after
CLI commands like `camel ps`
## Root Cause
`TerminalWidthHelper.getTerminalWidth()` was introduced in CAMEL-23237
(#22219). It creates a JLine `Terminal` with `system(true)` which sends escape
sequence queries to the terminal. The terminal responses arrive asynchronously
and can leak into the shell after the `Terminal` is closed:
```
PID NAME READY STATUS AGE TOTAL FAIL INFLIGHT
89933 circuit-breaker 1/1 Running 2m1s 119 32 0
^[[?64;1;2;4;6;17;18;21;22;52c^[[2;1R%
```
## Approach
Use `COLUMNS` env var (set by most shells) and `stty size` (POSIX) instead.
These detect terminal width without sending escape sequences. Falls back to the
default 120 columns if neither is available.
## Test plan
- [ ] Run `camel ps` — output should be clean, no trailing escape sequences
- [ ] Resize terminal, run `camel ps` — table should adapt to new width
- [ ] Pipe output (`camel ps | cat`) — should use default width (120)
_Claude Code on behalf of Claus Ibsen_
🤖 Generated with [Claude Code](https://claude.com/claude-code)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]