costajohnt · GitHub

@costajohnt

Adds useApp().suspendTerminal() so an Ink app can temporarily release the
terminal to a child process (e.g. $EDITOR, less, fzf) and then restore its
own terminal state with a full redraw.
- Callback form restores the terminal even if the callback throws.
- Disposable form (resume() and Symbol.asyncDispose) for `await using`.
- Releases raw mode, bracketed paste, the cursor, the alternate screen, and
  the kitty keyboard protocol, then reapplies them on resume.
- Suspending while already suspended throws; non-interactive output runs the
  callback without a terminal handoff.
Closes vadimdemedes#956

Read the original on github.com ↗