Adriano Machado created CAMEL-23818:
---------------------------------------

             Summary: camel tui: Actions menu (F2) leaves stray characters when 
scrolling over emoji rows
                 Key: CAMEL-23818
                 URL: https://issues.apache.org/jira/browse/CAMEL-23818
             Project: Camel
          Issue Type: Bug
    Affects Versions: 4.20.0
            Reporter: Adriano Machado


h3. Summary

In "camel tui", opening the Actions menu (F2) and scrolling through it with the
arrow keys leaves stray characters on screen after closing the menu without
selecting an action. The affected rows are "Start/Stop Tape Recording" and
"Show Keystrokes": moving the selection over them shifts the text one column to
the left and leaves leftover letters behind.

h3. Root cause

These are the only rows whose icon is an emoji presentation sequence (a
text-default base glyph followed by Variation Selector-16, U+FE0F):
* Start/Stop Tape Recording: U+23FA / U+23F9 + U+FE0F
* Show/Hide Keystrokes: U+2328 + U+FE0F

They render 2 columns wide in terminals, but the TUI library (TamboUI) measures
them as 1 column: CharWidth.of(String) sums base(1)+VS16(0), and 
Buffer.setString
places the glyph in a single cell without a continuation cell. The terminal's
2-wide glyph then drifts one column out of sync with the buffer, and the redraw
diff leaves ghost characters. Rows using regular wide emoji are unaffected.

h3. Fix

Root cause fixed upstream in TamboUI: 
https://github.com/tamboui/tamboui/pull/388
(base+VS16 now counts as width 2 and reserves a continuation cell).

A temporary Camel-side workaround in ActionsPopup.renderActionsMenu swaps the
three labels to unambiguous 2-wide emoji until a fixed TamboUI release is 
adopted
(bump tamboui-version in parent/pom.xml), after which the workaround can be 
reverted.

h3. Affects

camel-jbang TUI (camel-jbang-plugin-tui), 4.21.0-SNAPSHOT

_Reported by Claude Code on behalf of Adriano Machado._




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

Reply via email to