You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: cli/knowledge.md
+56-5Lines changed: 56 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -40,7 +40,30 @@ Dynamic imports make code harder to analyze, break tree-shaking, and can hide ci
40
40
41
41
Use tmux to test CLI behavior in a controlled, scriptable way. This is especially useful for testing UI updates, authentication flows, and time-dependent behavior.
42
42
43
-
### Basic Pattern
43
+
### Recommended: Use Helper Scripts
44
+
45
+
**Use the helper scripts in `scripts/tmux/`** for reliable CLI testing:
**Why standard send-keys fails:** When `tmux send-keys` sends multiple characters without bracketed paste mode, the CLI's input handling only captures some characters due to timing issues with OpenTUI's async event processing. This manifests as partial input (e.g., only the last character appearing in the input field like `a▍` instead of the full message).
90
-
91
-
**Bracketed paste mode** wraps the input in escape sequences (`\e[200~` start, `\e[201~` end) that signal to the terminal "this is pasted content" - the CLI handles this correctly and receives the full input.
92
-
93
112
## Migration from Custom OpenTUI Fork
94
113
95
114
**October 2024**: Migrated from custom `CodebuffAI/opentui#codebuff/custom` fork to official `@opentui/react@^0.1.27` and `@opentui/core@^0.1.27` packages. Updated to `^0.1.28` in February 2025.
@@ -103,6 +122,38 @@ tmux new-session -d -s test-session 'cd /path/to/codebuff && bun --cwd=cli run d
103
122
- Paste functionality still works through the terminal's native paste mechanism, but we can no longer intercept paste events separately from typing.
104
123
- If custom paste handling is needed in the future, it must be reimplemented using `useKeyboard` hook or by checking the official OpenTUI for updates.
105
124
125
+
## OpenTUI Flex Layouts
126
+
127
+
### Multi-Column / Masonry Layouts
128
+
129
+
For columns that share space equally within a container, use the **flex trio pattern**:
**Why not explicit width?** Using `width: someNumber` for columns causes OpenTUI to overflow beyond container boundaries. The flex trio pattern respects the parent container's width constraints.
151
+
152
+
**Key points:**
153
+
-`minWidth: 0` is essential - without it, content won't shrink below its natural width
154
+
- Use `width: '100%'` (string) for parent containers, not numeric values
155
+
-`alignItems: 'flex-start'` prevents children from stretching to fill row height
156
+
106
157
## OpenTUI Text Rendering Constraints
107
158
108
159
**CRITICAL**: OpenTUI has strict requirements for text rendering that must be followed:
0 commit comments