Adriano Machado created CAMEL-24397:
---------------------------------------

             Summary: camel-tui: --record produces no cast file because the 
recording backend is never applied
                 Key: CAMEL-24397
                 URL: https://issues.apache.org/jira/browse/CAMEL-24397
             Project: Camel
          Issue Type: Bug
            Reporter: Adriano Machado


h3. Problem

{{camel tui \-\-record=}} exits cleanly but neither replays the tape nor writes 
the {{.cast}} file. Nothing is logged, so the failure is indistinguishable from 
success.

h3. 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:

{code:java}
Backend backend = config.backend\(\) \!= null ? config.backend\(\) : 
BackendFactory.create\(\);
{code}

{{TuiBackendHelper}} always supplies an explicit {{JLineBackend}}, so 
{{BackendFactory.create\(\)}} never runs and recording is never engaged.

h3. Regression* 3c3f2687d9e8 \(2026\-05\-20\) added {{\-\-record}} and used a 
bare {{TuiRunner.create\(\)}}, so recording worked.
* 36f9299d1322 \(2026\-05\-26\) introduced the explicit backend and silently 
broke it.

The explicit backend is deliberate and must stay: with tamboui\-aesh\-backend 
on the classpath for {{\-\-web}}, ServiceLoader auto\-discovery can select 
AeshBackend for the local session, which does not shut down cleanly. The fix 
therefore applies the recording wrapper explicitly rather than reverting to 
auto\-discovery.

h3. Also in this change

The recording geometry was hardcoded at 200x50 \(plus fps 10 and duration 
120000\). 200 columns is too wide to embed in a documentation page, so 
{{\-\-record\-size}}, {{\-\-record\-fps}} and {{\-\-record\-duration}} are 
added. Defaults are unchanged.





--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to