Skip to content

[Bug] AI对话授权自动终端执行后, 在终端界面向上查询AI执行命令历史时, 会偶现部分命令行历史残留 #3265

Description

@Li12137

Operating system

Linux

Netcatty version

1.1.82

How did you install Netcatty?

GitHub Release (.dmg / .exe / .AppImage / .deb / .rpm / .pacman)

Affected area

SSH connection / terminal

Can you reproduce it?

Often (>50%)

Steps to reproduce

  1. 对话AI, 让他查询当前环境apt update 有可升级的, 依次进行升级, AI自动执行命令PASS (其他AI执行都可以复现)
  2. 当我在终端使用方向键向上箭头查询历史命令时, 偶现部分AI执行的命令会残留
    https://github.com/user-attachments/assets/0ea0e172-5048-49b9-a68d-7fa61573c9b0

Expected behavior

仅使用方向键向上箭头查询历史命令, 没执行, 不应该导致命令残留当前终端界面的

Actual behavior

体现在终端上就是, 比如我在行1上, 使用方向键向上箭头执行向上查询历史命令, 没执行 但是多了几行AI历史命令的残留, 再按方向键向下箭头直到最新的空行, 当前行数就变成3或者4, 中间的行2 是向上查询历史命令过程中残留了占用了

也不是所有AI执行的命令会残留, 我不清楚触发条件, 命令行过长?? 换行异常?

Logs / screenshots

wx0043@user-dev-wx0043-5b7dc77774-phvx9:$
wx0043@user-dev-wx0043-5b7dc77774-phvx9:
$ NCMCP_mtl4u3ie_fb5b5df195c7752b3e5cc1ee1b507a04=0; __NCMCP_mtl4u3ie_fb5b5df195c7752b3e5cc1ee1b507a04___cmd='sudo apt list --upgradable 2>/dev/null | grep -v "^Listing"'; { printf '%s\n' '__NCMCP_mtl4u3ie_fb5b5df195c7752b3e5cc1ee1b507a04___S'; trap ':' INT; ( PAGER=cat SYSTEMD_PAGER= GIT_PAGER=cat LESS= eval "$__NCMCP_mtl4u3ie_fb5b5df195c7752b3e5cc1ee1b507a04___cmd" ); __NCMCP_rc=$?; trap - INTwx0043@user-dev-wx0043-5b7dc77774-phvx9:$
wx0043@user-dev-wx0043-5b7dc77774-phvx9:
$

完整AI命令
NCMCP_mtl4u3ie_fb5b5df195c7752b3e5cc1ee1b507a04=0; __NCMCP_mtl4u3ie_fb5b5df195c7752b3e5cc1ee1b507a04___cmd='sudo apt list --upgradable 2>/dev/null | grep -v "^Listing"'; { printf '%s\n' '__NCMCP_mtl4u3ie_fb5b5df195c7752b3e5cc1ee1b507a04___S'; trap ':' INT; ( PAGER=cat SYSTEMD_PAGER= GIT_PAGER=cat LESS= eval "$__NCMCP_mtl4u3ie_fb5b5df195c7752b3e5cc1ee1b507a04___cmd" ); __NCMCP_rc=$?; trap - INTllib3 2>&1 | tail -3'; { printf '%s\n' '__NCMCP_mtl4tf5i_34ef25c55d323d3ac255a606f81e4c24___S'; trap ':' INT; ( PAGER=cat SYSTEMD_PAGER= GIT_PAGER=cat LESS= eval "$__NCMCP_mtl4tf5i_34ef25c55d323d3ac255a606f81e4c24___cmd" ); __NCMCP_rc=$?; trap - INT; printf '%s\n' '__NCMCP_mtl4tf5i_34ef25c55d323d3ac255a606f81e4c24___E:'"$__NCMCP_rc"; (exit $__NCMCP_rc); }

Before submitting

  • I searched existing issues and did not find a duplicate
  • I removed passwords, private keys, and other secrets from this report

Activity

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

    bugSomething isn't workingready-for-agentFully specified, ready for an AFK agenttriageTouched by Cursor automationtriage:admittedReserved for serialized automatic issue triage admissiontriage:bug-readyConfirmed Netcatty bug ready for automatic implementation

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions