Skip to content

fix(tui): Code Mode 截断后的行背景出现断层 #683

Open

Description

@tt-a1i

Problem

Code Mode 的 Bash 命令预览被截断后,卡片行右侧背景恢复为终端底色,出现明显横向断层。长脚本/结果的展开文本也可能经过同一个截断路径。用户提供的实际终端截图用于本地定位,不公开私人路径或截图内容。

Reproduction and cause

长 Bash 命令预览,例如 bunx biome format --write ...,在 40/120/240 列触发 Pi truncateToWidth 的 SGR ESC[0m 重置。OpenPI 只对整行包一次 theme.bg;内嵌重置取消背景,省略号和补齐空格不再具有卡片背景。

Expected

卡片每个可见字符及右侧补齐空间保留当前 pending/success/error 背景;原生截断、命令预览长度、文本、执行与工具结果不变。

Validation scope

使用保留 ANSI 的回归断言检查每个可见字符的背景,而不是先 strip ANSI 再比文本。修复前用例能明确复现省略号/右侧空格未着色。完整检查、原生 SDK smoke 和独立审核用于交付;当前运行中 Session 的真实终端画面需要 reload 后验收。

Related: #673, #681.

Activity

  1. tt-a1i commented on Oct 4, 2026

    @tt-a1i
    CollaboratorAuthor

    修复已提交 PR #684。新增 ANSI 状态回归在修复前明确失败于省略号和补齐空间失去背景;修复后 0.99.1 / 1.0.2 的 21 项 renderer/native 定向用例均通过,独立审核无阻断,完整静态检查通过。全量测试与 exact-head CI 正在运行。

    调查记录。仅在 OpenPI 的卡片背景层修复,不改 Pi 宿主、执行器、截断预算或工具结果;本地安装目录的其他修改已保留,真实运行中 Session reload 后画面仍待验收。

  2. tt-a1i commented on Oct 4, 2026

    @tt-a1i
    CollaboratorAuthor

    PR #684 已合并 main,merge commit 3cb2ecfe1bfbb98252651885311d309f83749428。修复前 ANSI 状态回归明确捕获省略号/右侧 padding 的未着色字符;修复后 0.99.1 / 1.0.2 定向 21/21 通过。本地 check/full test 通过(Node 2296 passed、9 skipped,326.49s;UI 1158 passed,32.79s),独立审核无阻断,提交 cf280d571b7f6556604bde7af2d624ef7d72d758 的 17 项 CI 全绿。

    main 调查记录。本地安装目录有其他未提交修改,未更新或 reload;此 issue 暂留开放,等待运行中 Session 重载后的真实终端画面验收。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions