This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch CAMEL-26854-tamboui-0.7
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 6ba722f00b79a30aa9d9299c1bc47d0757a0190f
Author: Claus Ibsen <[email protected]>
AuthorDate: Wed Nov 11 11:33:20 2026 +0100

    CAMEL-26854: camel-jbang - Upgrade TamboUI to 0.7.0
    
    TamboUI 0.7.0 turns on the Kitty keyboard protocol by default, and then
    some keys arrive differently. Stay on the legacy keys for now; switching
    to Kitty keys and reviewing the key bindings is a follow-up.
    
    --- Prompt to continue on another machine (copy from here) ---
    
    Continue CAMEL-26854 (camel-jbang - Upgrade TamboUI to 0.7.0, assigned to
    me, fix version 4.24.0, In Progress). The branch CAMEL-26854-tamboui-0.7
    is pushed to apache/camel with one commit: tamboui-version 0.7.0 in
    parent/pom.xml, and TuiBackendHelper sets KeyboardProtocol.LEGACY because
    0.7.0 defaults to the Kitty keyboard protocol (AUTO). A test in
    TuiBackendHelperRecordingTest checks it. This is the plain upgrade only;
    Kitty keys and new key bindings are a follow-up ticket.
    
    Done on the first machine:
    - All 2508 camel-jbang-plugin-tui tests pass on 0.7.0.
    - The jline3 backend is unchanged in 0.7.0 (still fine on JLine 4.4.8).
    - Camel does not use the TamboUI toolkit, so #481/#617 do not apply; it
      uses the default binding set, so #492 does not change anything.
    - The parser fixes #611/#517 apply even with LEGACY: Alt+Enter,
      Alt+Backspace and two quick Escapes now arrive as real keys.
    - A pseudo-terminal smoke test started camel tui, it reacted to Tab, F1
      and Esc and quit on Ctrl+C, with no Kitty push sequence. The word
      "Error" showed somewhere on the captured screen; not checked yet.
    
    Next steps:
    1. Create a worktree for the branch in ~/workspace/camel-wt (never check
       out branches in ~/workspace/camel), then install camel-parent
       (mvn install -pl parent -q) and the plugin (mvn install -pl
       dsl/camel-jbang/camel-jbang-plugin-tui -DskipTests -q), so the TUI
       from ~/.m2 loads 0.7.0. Do not install while a camel tui is running.
    2. Have me run camel tui in a real terminal (also a Kitty-capable one such
       as Ghostty or Kitty) and walk the keys: tabs, F-keys, popups, text
       input, AI prompt, Alt+Up/Down in the source editor, mouse, paste, and
       the web session. Find where "Error" shows on screen.
    3. Format (mvn formatter:format impsort:sort in the module), open the PR
       against main with milestone 4.24.0 (gh api), no reviewers. PR body:
       what changed and why LEGACY, plus the follow-up list.
    4. File follow-up JIRAs (no "TUI" in titles): Kitty keyboard protocol and
       key bindings (Alt+Enter line break in the AI prompt); TextEditing +
       KeyEvent.isTyping() (#612) and word-wise cursor movement (#616);
       Constraint.fit() table column widths (#620); mouse commands in the
       tape recorder (#624); remove workarounds fixed in 0.7.0 (check the
       list in CAMEL-25580).
    
    Co-Authored-By: Claude Opus 5.5 <[email protected]>
    Signed-off-by: Claus Ibsen <[email protected]>
---
 .../dsl/jbang/core/commands/tui/TuiBackendHelper.java     |  6 +++++-
 .../camel/dsl/jbang/core/commands/tui/NoopBackend.java    | 15 +++++++++++++++
 .../core/commands/tui/TuiBackendHelperRecordingTest.java  | 11 +++++++++++
 parent/pom.xml                                            |  2 +-
 4 files changed, 32 insertions(+), 2 deletions(-)

diff --git 
a/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/TuiBackendHelper.java
 
b/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/TuiBackendHelper.java
index 7ac2b6fe7f12..b4af04dc2cbb 100644
--- 
a/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/TuiBackendHelper.java
+++ 
b/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/TuiBackendHelper.java
@@ -18,6 +18,7 @@ package org.apache.camel.dsl.jbang.core.commands.tui;
 
 import dev.tamboui.backend.jline3.JLineBackend;
 import dev.tamboui.terminal.Backend;
+import dev.tamboui.terminal.KeyboardProtocol;
 import dev.tamboui.tui.TuiConfig;
 import dev.tamboui.tui.TuiRunner;
 import org.apache.camel.dsl.jbang.core.common.EnvironmentHelper;
@@ -42,7 +43,10 @@ final class TuiBackendHelper {
      * itself when {@code --record} configured the {@code tamboui.record*} 
system properties.
      */
     static TuiRunner createTuiRunner(Backend backend) throws Exception {
+        // TamboUI 0.7 turns on the Kitty keyboard protocol by default, and 
then some keys arrive differently
+        // (Ctrl+I vs Tab, Esc and Alt combinations); stay on the legacy keys 
until the key bindings are reviewed
         return TuiRunner.create(
-                
TuiConfig.builder().backend(backend).mouseCapture(true).bracketedPaste(true).build());
+                
TuiConfig.builder().backend(backend).mouseCapture(true).bracketedPaste(true)
+                        .keyboardProtocol(KeyboardProtocol.LEGACY).build());
     }
 }
diff --git 
a/dsl/camel-jbang/camel-jbang-plugin-tui/src/test/java/org/apache/camel/dsl/jbang/core/commands/tui/NoopBackend.java
 
b/dsl/camel-jbang/camel-jbang-plugin-tui/src/test/java/org/apache/camel/dsl/jbang/core/commands/tui/NoopBackend.java
index 4090a78aef9b..1778e0e191be 100644
--- 
a/dsl/camel-jbang/camel-jbang-plugin-tui/src/test/java/org/apache/camel/dsl/jbang/core/commands/tui/NoopBackend.java
+++ 
b/dsl/camel-jbang/camel-jbang-plugin-tui/src/test/java/org/apache/camel/dsl/jbang/core/commands/tui/NoopBackend.java
@@ -22,6 +22,7 @@ import dev.tamboui.buffer.DiffResult;
 import dev.tamboui.layout.Position;
 import dev.tamboui.layout.Size;
 import dev.tamboui.terminal.Backend;
+import dev.tamboui.terminal.KeyboardProtocol;
 
 /**
  * Minimal {@link Backend} stand-in. Only {@link #size()} needs a meaningful 
value, so that the test fails if the
@@ -31,6 +32,7 @@ final class NoopBackend implements Backend {
 
     private final int[] input;
     private int inputPos;
+    private KeyboardProtocol keyboardProtocol;
 
     /**
      * @param input the bytes the terminal sends, read through TamboUI's event 
parser by tests of key handling
@@ -103,6 +105,19 @@ final class NoopBackend implements Backend {
         return inputPos < input.length ? input[inputPos] : -2;
     }
 
+    @Override
+    public boolean enableKeyboardProtocol(KeyboardProtocol protocol) throws 
IOException {
+        keyboardProtocol = protocol;
+        return Backend.super.enableKeyboardProtocol(protocol);
+    }
+
+    /**
+     * @return the keyboard protocol TuiRunner asked for, or null when it did 
not ask
+     */
+    KeyboardProtocol keyboardProtocol() {
+        return keyboardProtocol;
+    }
+
     @Override
     public void writeRaw(byte[] data) throws IOException {
         // TuiRunner.create enables bracketed paste through this method
diff --git 
a/dsl/camel-jbang/camel-jbang-plugin-tui/src/test/java/org/apache/camel/dsl/jbang/core/commands/tui/TuiBackendHelperRecordingTest.java
 
b/dsl/camel-jbang/camel-jbang-plugin-tui/src/test/java/org/apache/camel/dsl/jbang/core/commands/tui/TuiBackendHelperRecordingTest.java
index d806b3d4fb7d..4dcd75d1cb0b 100644
--- 
a/dsl/camel-jbang/camel-jbang-plugin-tui/src/test/java/org/apache/camel/dsl/jbang/core/commands/tui/TuiBackendHelperRecordingTest.java
+++ 
b/dsl/camel-jbang/camel-jbang-plugin-tui/src/test/java/org/apache/camel/dsl/jbang/core/commands/tui/TuiBackendHelperRecordingTest.java
@@ -22,6 +22,7 @@ import java.nio.file.Path;
 import dev.tamboui.internal.record.AnsiTerminalCapture;
 import dev.tamboui.layout.Size;
 import dev.tamboui.terminal.Backend;
+import dev.tamboui.terminal.KeyboardProtocol;
 import dev.tamboui.tui.TuiRunner;
 import org.junit.jupiter.api.AfterEach;
 import org.junit.jupiter.api.Test;
@@ -70,6 +71,16 @@ class TuiBackendHelperRecordingTest {
         }
     }
 
+    @Test
+    void theTerminalStaysOnTheLegacyKeyboardProtocol() throws Exception {
+        // TamboUI 0.7 defaults to the Kitty keyboard protocol, which changes 
how some keys arrive
+        NoopBackend backend = new NoopBackend();
+
+        try (TuiRunner runner = TuiBackendHelper.createTuiRunner(backend)) {
+            
assertThat(backend.keyboardProtocol()).isEqualTo(KeyboardProtocol.LEGACY);
+        }
+    }
+
     @Test
     void withRecordOptionTheBackendIsWrappedAndSizedFromTheRecordingConfig() 
throws Exception {
         Path tape = tempDir.resolve("demo.tape");
diff --git a/parent/pom.xml b/parent/pom.xml
index 8a012964fe40..5d0a1cade58a 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -535,7 +535,7 @@
         <swagger-ui-version>5.34.1</swagger-ui-version>
         <stringtemplate-version>4.3.4</stringtemplate-version>
         <tahu-version>1.0.21</tahu-version>
-        <tamboui-version>0.6.0</tamboui-version>
+        <tamboui-version>0.7.0</tamboui-version>
         <testcontainers-version>2.0.5</testcontainers-version>
         <thymeleaf-version>3.1.5.RELEASE</thymeleaf-version>
         <tika-version>4.1.0</tika-version>

Reply via email to