[Bug]: TUI word wrap, LaTeX parsing, and bracketed paste can run without a bound

オープン
#613 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
1/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
node.js, typescript
領域
cli, testing

調査の方向性

The linked fix branch already contains changes for wordWrapLine, LaTeX parsing, and paste limits in StdinBuffer, Input, and Editor, with focused tests under packages/tui/test/unit/. Read the commits from 203278f through b1bfc9a and compare them with 3c21163; the issue says the targeted Vitest run passes 21 tests. Work is already under way, and the report says external pull requests are not accepted.

索引モデルが issue の本文から書いたものです。

説明

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:

  1. Word wrap: render a line that contains one wide grapheme, such as a CJK character or an emoji, with wordWrapLine when the terminal content width is 1 column.
  2. LaTeX: call renderLatex with a few hundred unmatched { characters, or with environments nested a few hundred levels deep.
  3. 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 in StdinBuffer, Input, and Editor.

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: wordWrapLine recurses on that same grapheme until the stack overflows; renderLatex recurses 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.

  • wordWrapLine recurses 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, and Editor drop 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 [email protected] 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.
主要言語
TypeScript
スター
2.3k
フォーク
315
平均マージ
3時間 54分
マージ済み PR(30日)
9

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

MiniMax-AI/minimax-code のほかの issue

MiniMax-AI/minimax-code の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。