v8.0.02026-10-03
Breaking
- Require React 19.3+ 7829102
- minWidth and maxWidth on <Box> now only accept numbers (#1029) 7cd7fd9
- Percentage strings were never documented as supported, and Yoga resolved them against the wrong ancestor
- stdin, stdout, and stderr are now typed as generic Node.js streams (#981) eb82d8f
- This applies to the render() options and to useStdin(), useStdout(), and useStderr(). TTY-only properties like stdout.columns are no longer part of the types
- useInput no longer receives unrecognized terminal control sequences (#1014) c76893e
- Mouse reports, focus in/out events, cursor position reports, and other terminal replies used to arrive in input with the ESC stripped, as if typed. They are now dropped
New
- Add contentOffsetX and contentOffsetY props to <Box> for building scrollable views (#765) 3ba5828
- Combine with overflow="hidden". See the scroll example
- Add clientWidth and clientHeight to useBoxMetrics() and measureElement() (#988) 3ba5828
- The element size excluding borders, which is the space its content can occupy
- Accept any Node.js stream for the stdin, stdout, and stderr options of render() (#981) eb82d8f
- For example, PassThrough or other Readable/Writable streams. Raw mode is used only when stdin is a TTY with setRawMode()
- Skip unchanged line prefixes in incrementalRendering mode (#1036) 91eb50a
- Only the changed part of a line is written, which reduces output and flicker
- Drop the ws dependency in favor of the native WebSocket for React DevTools (#976) 33567ed
- Recognize application keypad Enter as key.return b73ebf4
Fixes
Rendering
- Preserve scrollback when clearing the viewport (#994) fe1d123
- Preserve terminal history after clear() 494ebeb
- Restore the unchanged frame when rerendering after clear() fc358c2
- Redraw the frame when the terminal loses rows (#1025) f603aeb
- Keep content above the frame when rows shrink while the cursor is shown (#1031) c800284
- Keep the cursor on the last line when output has no trailing newline (#982) cdc18fa
- Restore the terminal cursor below the frame on exit 06385e9
- Preserve the cursor position when its component skips rendering 013feb2
- Fix incremental rendering of single-line updates, new blank rows, and changed rows (#1039) 9a501e4 507c0c9 509ea75
- Fix overflow clipping when both the shorthand and an explicit axis are set, and preserve <Transform> line indices when clipping 4f3c7aa
- Fix background color inheritance for <Static> and nested <Text> 753a5f8
- Fix fractional percentages being truncated in layout sizes, and restore layout defaults when style props are undefined 274b15a
- Preserve visibility across Suspense transitions fc685bc
- Call onRender after the frame is written 83d7de5
<Static>
- Stop replaying <Static> output on full-clear frames (#1005) d661543
- Replay <Static> output when resuming re-enters the alternate screen (#1012) 9235028
- Fix repeated padding, ignored margins, and output inside hidden ancestors 793fe59
- Keep <Static> output after abandoned concurrent renders 8678b76
- Reset captured <Static> output when its identity changes cfdd9e6
- Preserve blank <Static> rows f6b2620 c0fa4ef 5911f44
- Fix dangling staticNode reference on indirect subtree removal (#979) 5448e6b
Text
- Truncate each line of multi-line text separately (#1006) 4b44934
- Keep text at its natural width when there is no room to wrap (#1022) 36f5624
- Fix multi-line <Text> vanishing when it starts above the top of the output (#1001) 77aba4a
- Strip control characters (except tab and newline) from text content (#1020) 405f751 2fbc26a
- Expand tabs, and fix CRLF text overwriting box borders and zero-width spaces overwriting surrounding output 32dc266
- Preserve ANSI styles across explicit newlines b419e5c
- Preserve combining marks across nested text styles 80b1c9c
- Normalize colon and C1 SGR sequences before layout (#1019) b0dfd61 9dfe137 7fe1577
- Preserve styles and columns on clipped or overwritten wide characters f7e57a5 064df65
- Remeasure text when its wrapping mode or <Transform> wrap points change fc685bc 9c323f6
- Preserve the available width when measuring truncated text 1e57b23
- Fix crashes from invalid color names, and whitespace handling in RGB colors 3be9ed7
Input
- Fix legacy keyboard modifiers, modified SS3 keys, and Kitty keyboard parsing and detection 2ee828c
- reportAssociatedText now enables reportAllKeysAsEscapeCodes automatically
- Handle Ctrl+C that arrives together with ordinary input 13707d2
- Do not mutate the caller's buffer when parsing Meta keys 36d7739
- Keep onKittyQueryResponse stable across rerender() calls (#1007) 70beca5
- Defer input hook side effects while the terminal is suspended (#1016) 61004d7
- Make suspendTerminal() handles idempotent, and do not restore input modes that were released or belong to an unmounted app a7297c4 b35e89a c613707
- Preserve output during non-interactive terminal suspension a6789fb
Focus
- Treat components that share a focus ID as one Tab stop (#1026) 02ae1e5
- Make disableFocus() blur the focused component as documented, and respect it when new components auto-focus d130588
- Prevent collisions in automatically generated focus IDs d130588
- Treat an empty string as a valid focus ID f6f7dc7
Other
- Fix screen-reader output: semantic text and labels, empty <Transform> labels, rewrapping when the terminal widens, and restoring output after console writes (#1028) f480301 bebfe2d
- Fix error source excerpts for file URLs and multiline messages, and treat non-Error throws as rendering failures 81e2451
- Fix renderToString() swallowing thrown undefined, and run effect cleanup when output rendering fails 9f7c1d0
- Fix useWindowSize() missing resizes before it subscribes fab670b
- Track box metrics when a child attaches the ref after mount 53244dc
- Reset useAnimation() values while paused f25d312
- Use defaults for render() options that are undefined 659249d
- Fix unbounded text caches (#986) ad9e3ea
- Fix wrapText cache returning results for the wrong text or width (#998) 3809acc
- Free the root Yoga node on unmount (#999) 064b4f6
- Avoid retaining an exit listener when calling waitUntilExit() after unmount 1fcd380
---
Migration guide
React 19.3
Upgrade react (and @types/react) to 19.3 or later.
minWidth and maxWidth
Use a number. If you need a relative minimum or maximum width, compute it from useWindowSize() or useBoxMetrics() of the parent.
``diff
-<Box minWidth="50%">
+<Box minWidth={Math.floor(columns / 2)}>
`
Stream types
useStdout().stdout is now typed as NodeJS.WritableStream, so TTY properties like columns and rows are no longer available in the types. Use useWindowSize() instead, which also re-renders on resize.
``diff
-const {st
v7.1.12026-07-16
- Fix: Preserve last <Static> line erased after a full-clear frame (#974) e51dfdd
- Make measureElement() also return position coordinates (#968) c073b27
---
https://github.com/vadimdemedes/ink/compare/v7.1.0...v7.1.1
v7.1.02026-06-17
- Add suspendTerminal() to hand the terminal to a child process (#972) 9e8ed1f
---
https://github.com/vadimdemedes/ink/compare/v7.0.6...v7.1.0
v7.0.62026-06-12
- Fix stale frames on Windows when output exactly fills the terminal (#971) 2c08d55
---
https://github.com/vadimdemedes/ink/compare/v7.0.5...v7.0.6
v7.0.52026-05-29
- Fix: Handle incomplete stack frames in error overview (#965) b2350c1
---
https://github.com/vadimdemedes/ink/compare/v7.0.4...v7.0.5
v7.0.42026-05-24
- Fix: Share resize listener via emitLayoutListeners instead of per-hook listeners (#952) 89d43d8
- Fix: Remove useEffectEvent functions from useEffect dependency arrays (#960) 9d534f7
---
https://github.com/vadimdemedes/ink/compare/v7.0.3...v7.0.4
v7.0.32026-05-13
- Fix: Drop stale <Static> output from fullStaticOutput on identity change (#950) 669c438
- Fix: <Static> remount via key change drops new items (#948) be9f44c
- Fix useBoxMetrics not accepting ref objects with an initial null value (#945) 7c2267c
---
https://github.com/vadimdemedes/ink/compare/v7.0.2...v7.0.3
v7.0.22026-05-05
- Fix: Defer raw mode disable to prevent process hang on component swap dd052ea
---
https://github.com/vadimdemedes/ink/compare/v7.0.1...v7.0.2
v7.0.12026-04-17
- Fix: Restore useApp exit typing 42ddd40
- Fix: Respect disableFocus() when handling Escape (#937) cb66873
---
https://github.com/vadimdemedes/ink/compare/v7.0.0...v7.0.1
v7.0.02026-04-08
Breaking
- Require Node.js 22 19b5316
- Require React 19.2+ cfaebbb
- Ink now uses useEffectEvent internally to avoid re-subscribing input handlers on every render
- Pressing Backspace now correctly sets key.backspace instead of key.delete (#634) 321a2e8
- Most terminals send the same byte for Backspace as the Delete key, which caused Ink to misreport it. If you were checking key.delete to handle backspace, switch to key.backspace
- key.meta is no longer set to true when Escape is pressed e195912
- Previously a backward-compat shim made plain Escape set both key.escape and key.meta. Now only key.escape is true. key.meta is reserved for actual Alt/Meta modifier combinations
New
- Add usePaste hook for handling clipboard paste events fbbeb23
- Automatically enables bracketed paste mode so pasted text arrives as a single string, never misinterpreted as individual key presses by useInput
- Add useWindowSize hook 7047795
- Returns {columns, rows} and re-renders automatically on terminal resize
- Add useBoxMetrics hook for measuring box dimensions at runtime (#433) 88731d1
- Add useAnimation hook for built-in animation support (#142) ada019c
- Provides a frame counter that increments at a configurable interval, with pause/resume support and automatic cleanup on unmount
- Add alternateScreen option to render() (#263) 5a60eb9
- Renders into the terminal's alternate screen buffer (like vim or less), restoring the previous terminal content on exit
- Add interactive option to render() (#888) 02490f6
- Override automatic interactive-mode detection for environments where the built-in heuristic doesn't fit
- Add activeId to useFocusManager() (#661) eb2f470
- Returns the ID of the currently focused component, or undefined if nothing is focused
- Add borderBackgroundColor (and per-side variants) to <Box> (#906) d3c6d14
- Set a background color on borders independently from the box content background
- Add wrap="hard" to <Text> (#925) 2b1e3a6
- Fills each line to the full column width, breaking words mid-word as needed
- Add maxWidth and maxHeight props to <Box> (#713) 9291794
- Add aspectRatio, alignContent, position="static", and top/right/bottom/left layout props to <Box> c2f4b86
- Kitty keyboard protocol: query all terminals in auto mode instead of a hardcoded allowlist (#895) 3e672b5
Fixes
- Fix incremental rendering for trailing newline (#910) c32da0b
- Fix useInput crash on unmapped key codes (#902) 969a4f1
- Fix CJK text truncation exceeding <Box> width b5f3e3a
- Fix splitting wide characters (emoji, CJK) when overlapping writes occur (#930) 06d53f4
- Fix dangling staticNode reference (#905) 0dc4dfa
---
Migration guide
key.backspace vs key.delete
``js
// Before — physical backspace was reported as key.delete
useInput((input, key) => {
if (key.delete) { / was catching physical backspace key / }
});
// After
useInput((input, key) => {
if (key.backspace) { / physical backspace key (0x7F) / }
if (key.delete) { / actual Delete key (e.g. Fn+Backspace) / }
});
`
key.meta no longer set on plain Escape
`js
// Before — key.meta was true for both Escape AND Alt+key
useInput((input, key) => {
if (key.meta) { / fired on plain Escape too / }
});
// After — check key.escape explicitly for the Escape key
useInput((input, key) => {
if (key.escape) { / plain Escape / }
if (key.meta) { / Alt/Meta combos only / }
});
``
---
https://github.com/vadimdemedes/ink/compare/v6.8.0...v7.0.0