Repository navigation
Description
Summary
Three interactive TUI paths can run without a bound and take down the client. External pull requests are not accepted from this account. The fix branch is linked below.
Searched existing issues first. #32 is a LaTeX display question, and #491 is a clipboard-paste contribution question. Neither is this recursion or buffer bound.
Product or interface
CLI - interactive TUI. Source build.
Version
Source main at 3c21163 (chore(sdk-python): release 0.1.1). Node.js v24.19.0. pnpm 9.12.0.
Platform
Windows 11 Pro, build 26200.
Issue area
UI / UX.
Steps to reproduce
On 3c21163:
- Word wrap: render a line that contains one wide grapheme, such as a CJK character or an emoji, with
wordWrapLinewhen the terminal content width is 1 column. - LaTeX: call
renderLatexwith a few hundred unmatched{characters, or with environments nested a few hundred levels deep. - Paste: send a bracketed-paste start (
ESC [200~) and keep sending data with no end marker until the buffer passes 1 MiB. The same buffer exists inStdinBuffer,Input, andEditor.
Expected and actual behavior
- Expected: a single wide grapheme is emitted as its own visual chunk; LaTeX deeper than a small fixed depth is treated as unsupported; an oversized or unterminated paste is dropped and the input path accepts later keystrokes.
- Actual:
wordWrapLinerecurses on that same grapheme until the stack overflows;renderLatexrecurses once per nested group or environment until the stack overflows; the paste buffer grows for as long as the end marker is absent.
Branch
https://github.com/Coff0xc/minimax-code/tree/fix/code-defects
Head b1bfc9a. Commits from 203278f through b1bfc9a, based on 3c21163.
wordWrapLinerecurses only when a segment contains more than one grapheme.- LaTeX parsing shares a depth of 64 across nested braces and nested environment parsers.
StdinBuffer,Input, andEditordrop a bracketed paste larger than 1 MiB and leave paste mode.
Validation
Windows, Node.js v24.19.0, Vitest 4.1.11, on the committed sources:
npx --yes pnpm@9.12.0 exec vitest run --config vitest.oss.config.mjs packages/tui/test/unit/tui-word-wrap-wide-grapheme.test.ts packages/tui/test/unit/tui-latex-parse-depth.test.ts packages/tui/test/unit/tui-terminal-text-paste.test.ts
21 passed: word wrap 5, LaTeX depth 3, paste 13.
NOT RUN: pnpm verify, and Linux or macOS CI. The paste cap was exercised with synthetic input, not a physical terminal paste.
Checklist
- I have searched existing issues.
- I have included the version and removed sensitive information.
Activity