MCPcopy Index your code
hub / github.com/codeaashu/claude-code / enterAlternateScreen

Method enterAlternateScreen

src/ink/ink.tsx:357–378  ·  view source on GitHub ↗

* 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.

()

Source from the content-addressed store, hash-verified

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.

Callers 4

showShellMethod · 0.80
openFileInExternalEditorFunction · 0.80
editFileInEditorFunction · 0.80
playAnimationFunction · 0.80

Calls 3

pauseMethod · 0.95
suspendStdinMethod · 0.95
writeMethod · 0.45

Tested by

no test coverage detected