Commit 10f939e
feat(console): cluster 1 polish — search, paste guard, shortcut, tab rename (#143)
* feat(console): cluster 1 polish — search, paste guard, shortcut, tab rename
Refs #142 (cluster 1).
- xterm-addon-search vendored (@xterm/addon-search 0.15.0).
- Search bar markup + CSS: input, prev/next, count, close, Esc to close.
Ctrl-F / Cmd-F inside the terminal is intercepted via
attachCustomKeyEventHandler so it opens the find bar instead of going
to the shell. Each session lazy-loads its own search addon on first
use. Result count is rendered live via the addon's
onDidChangeResults callback ("3 / 12").
- Large-paste confirm modal: pastes with >= 20 newlines pop a modal
with a preview (capped at first 30 lines / 1200 chars). Confirm
pipes the text into the active session's PTY via the new
ConsoleSession.sendText path; Cancel discards. Document-level paste
listener checks that an xterm host is focused before intercepting.
Bracketed paste itself rides on the remote shell turning DECSET
2004 on — xterm wraps with ESC[200~/ESC[201~ automatically when
asked, so no client-side toggle needed.
- Ctrl-Shift-` global shortcut opens a console for the current box
(reads the box_id cookie set by switchBox). No-op when no box is
pinned — palette is the fallback.
- Double-click on a tab label swaps the label into an inline text
input; blur/Enter commits, Escape reverts. The rename is per-session
(lives on session.label); session.baseLabel still carries the
canonical box name for tooltips and #N disambiguation.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* address Copilot review findings on PR #143
- Global Ctrl-Shift-` shortcut now reads the correct cookie name
(gearbox_active_box, not box_id) and wires eagerly on
DOMContentLoaded so it works before the user has opened the
console once.
- Add .console-search-bar.hidden and .console-paste-modal.hidden to
the .hidden specificity-override block; Tailwind's .hidden was
losing the cascade tie to our component display rules.
- Paste threshold now counts actual newline characters (>= 20)
rather than split('\n').length, removing the off-by-one and the
trailing-newline edge case. Visible "N lines" label reads
newlines + 1 to match how users count.
- Confirmed paste routes through term.paste(text) so xterm applies
its normal paste pipeline including bracketed-paste wrapping
(ESC[200~ ... ESC[201~) when the remote shell has DECSET 2004
enabled. Direct sendText was bypassing that.
- Drop dead CSS rules targeting .xterm-decoration.console-search-*.
The xterm-addon-search uses its own class names
(xterm-find-result-decoration / xterm-find-active-result-decoration)
and we already pass decorations.{activeMatchBackground,matchBackground}
options in JS, so the CSS was unreachable.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 334c2e9 commit 10f939e
4 files changed
Lines changed: 526 additions & 3 deletions
File tree
- gearbox
- internal/framework/templates/components
- static
- css/components
- js
- console
- vendor
Lines changed: 54 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
116 | 116 | | |
117 | 117 | | |
118 | 118 | | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
119 | 158 | | |
120 | 159 | | |
121 | 160 | | |
122 | 161 | | |
123 | 162 | | |
124 | 163 | | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
125 | 178 | | |
126 | 179 | | |
127 | 180 | | |
| |||
133 | 186 | | |
134 | 187 | | |
135 | 188 | | |
| 189 | + | |
136 | 190 | | |
137 | 191 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
68 | | - | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
69 | 71 | | |
70 | 72 | | |
71 | 73 | | |
| |||
203 | 205 | | |
204 | 206 | | |
205 | 207 | | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
206 | 222 | | |
207 | 223 | | |
208 | 224 | | |
| |||
231 | 247 | | |
232 | 248 | | |
233 | 249 | | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
234 | 360 | | |
235 | 361 | | |
236 | 362 | | |
| |||
0 commit comments