ammachado opened a new pull request, #25514:
URL: https://github.com/apache/camel/pull/25514

   # Description
   
   `camel tui --record=<tape>` exits cleanly but neither replays the tape nor 
writes the `.cast` file. Nothing is logged, so the failure is indistinguishable 
from success. This is the path documented as "Scripted Recording" in 
`camel-jbang-tui.adoc`.
   
   ## Root cause
   
   `CamelMonitor` sets the `tamboui.record*` system properties correctly, but 
nothing ever reads them.
   
   TamboUI applies recording in exactly one place, `BackendFactory.create()`, 
which calls `RecordingConfig.load()` (installing the `System.out` capture and 
the shutdown hook that writes the cast) and wraps the backend in 
`RecordingBackend` (which loads the tape via `InteractionPlayer`).
   
   `TuiRunner.create()` only calls that factory when no explicit backend is 
configured:
   
   ```java
   Backend backend = config.backend() != null ? config.backend() : 
BackendFactory.create();
   ```
   
   `TuiBackendHelper` always supplies an explicit `JLineBackend`, so 
`BackendFactory.create()` never runs. That single cause explains both symptoms 
at once (no replay *and* no cast) plus the clean exit.
   
   ## Regression
   
   | Commit | Date | Effect |
   |---|---|---|
   | 3c3f2687d9e8 | 2026-05-20 | Adds `--record`, using a bare 
`TuiRunner.create()`. Worked. |
   | 36f9299d1322 | 2026-05-26 | "Reuse shell terminal for TUI subcommands" 
introduces the explicit backend. Silently broke it. |
   
   The explicit backend is deliberate and has to stay. As the comment in 
`TuiBackendHelper` records, with `tamboui-aesh-backend` on the classpath for 
`--web`, ServiceLoader auto-discovery can select `AeshBackend` for the local 
session, which drives a native `PosixSysTerminal` that does not shut down 
cleanly. Reverting to auto-discovery would restore recording and reintroduce 
that bug, so this change applies the recording wrapper explicitly instead.
   
   ## Recording geometry
   
   The recording size was hardcoded at 200x50, along with fps 10 and duration 
120000. 200 columns is too wide to embed in a documentation page (roughly 5px 
per character in an 800px content column). This adds `--record-size`, 
`--record-fps` and `--record-duration`. **Defaults are unchanged**, so no 
existing command line behaves differently and no upgrade guide entry is needed.
   
   ## Follow-up upstream
   
   `dev.tamboui.internal.record` is documented as internal API. A companion 
change proposed to TamboUI adds a public 
`BackendFactory.applyRecording(Backend)` and makes `TuiRunner` wrap explicitly 
configured backends, fixing this at the source for every downstream 
application. It is idempotent, so this Camel-side wrap and the upstream one 
compose safely and Camel can drop its own once the version pin moves.
   
   # Target
   
   - [x] main
   
   # Tracking
   
   - [x] https://issues.apache.org/jira/browse/CAMEL-24397
   
   # Apache Camel coding standards and style
   
   - [x] I checked that each commit in the pull request has a meaningful 
subject line and body.
   - [x] I have run `mvn clean install -DskipTests` locally and I have 
committed all auto-generated changes.
   
   # Verification
   
   - `mvn test -pl dsl/camel-jbang/camel-jbang-plugin-tui`: **995 tests, 0 
failures**, including two new test classes.
   - End to end: ran `camel tui --record=demo.tape --record-size=120x30` 
against the built module in a **non-tty** environment. It printed `Recording 
saved to: .../demo.cast` / `Frames captured: 21` and produced a valid asciicast 
v2 file whose header reads `"width": 120, "height": 30`, confirming both the 
fix and the new sizing option.
   
   ---
   
   _Claude Code on behalf of @ammachado_
   
   🤖 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]

Reply via email to