This is an automated email from the ASF dual-hosted git repository. davsclaus pushed a commit to branch fix/camel-tui-cosmetic in repository https://gitbox.apache.org/repos/asf/camel.git
commit b8b59e2bbb3912cb6ed3c90857ba685fe005f29c Author: Claus Ibsen <[email protected]> AuthorDate: Fri May 15 19:33:38 2026 +0200 Fix TUI garbage rendering caused by tab characters in stack trace log lines TamboUI's backend skips absolute cursor repositioning for consecutive cells: it relies on the terminal advancing the cursor by exactly 1 per cell. Tab characters (\t) in stack trace lines break this assumption: CharWidth.of('\t') returns 0 so the tab is merged into the preceding cell's symbol, and when written to the terminal it jumps the cursor to the next tab stop (column 8, 16, ...) instead of 1. All subsequent consecutive cells land at wrong terminal positions. Since TamboUI's buffer model does not track actual terminal cursor state, the diff never corrects these positions and the corruption persists across tab switches. Fix: replace \t with two spaces in TuiHelper.stripAnsi, which preserves stack-trace indentation visually without causing tab-stop cursor jumps. --- .../java/org/apache/camel/dsl/jbang/core/commands/tui/TuiHelper.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/TuiHelper.java b/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/TuiHelper.java index c8c9471b23b0..b5999b8c3beb 100644 --- a/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/TuiHelper.java +++ b/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/TuiHelper.java @@ -160,7 +160,10 @@ final class TuiHelper { i++; // unrecognised, skip just the ESC } } else if (ch == '\r') { - i++; // strip carriage returns (Windows line endings, progress output) + i++; + } else if (ch == '\t') { + sb.append(" "); // two spaces -- preserves stack-trace indentation without tab-stop jumps + i++; } else { sb.append(ch); i++;
