* Pause Ink and hand the terminal over to an external TUI (e.g. git * commit editor). In non-fullscreen mode this enters the alt screen; * in fullscreen mode we're already in alt so we just clear it. * Call `exitAlternateScreen()` when done to restore Ink.
()
| 355 | * Call `exitAlternateScreen()` when done to restore Ink. |
| 356 | */ |
| 357 | enterAlternateScreen(): void { |
| 358 | this.pause(); |
| 359 | this.suspendStdin(); |
| 360 | this.options.stdout.write( |
| 361 | // Disable extended key reporting first — editors that don't speak |
| 362 | // CSI-u (e.g. nano) show "Unknown sequence" for every Ctrl-<key> if |
| 363 | // kitty/modifyOtherKeys stays active. exitAlternateScreen re-enables. |
| 364 | DISABLE_KITTY_KEYBOARD + DISABLE_MODIFY_OTHER_KEYS + (this.altScreenMouseTracking ? DISABLE_MOUSE_TRACKING : '') + ( |
| 365 | // disable mouse (no-op if off) |
| 366 | this.altScreenActive ? '' : '\x1b[?1049h') + |
| 367 | // enter alt (already in alt if fullscreen) |
| 368 | '\x1b[?1004l' + |
| 369 | // disable focus reporting |
| 370 | '\x1b[0m' + |
| 371 | // reset attributes |
| 372 | '\x1b[?25h' + |
| 373 | // show cursor |
| 374 | '\x1b[2J' + |
| 375 | // clear screen |
| 376 | '\x1b[H' // cursor home |
| 377 | ); |
| 378 | } |
| 379 | |
| 380 | /** |
| 381 | * Resume Ink after an external TUI handoff with a full repaint. |
no test coverage detected