Skip to content

[Bug]: Text duplication and ghosting when using interactive CLI tools with CJK characters #104

@ShangYi7

Description

@ShangYi7

[Bug]: Text duplication and ghosting when using interactive CLI tools with CJK characters

Describe the bug

When running interactive CLI tools (specifically Gemini CLI) inside the integrated terminal, the output lines are duplicated and stacked infinitely. This occurs whenever a character is typed or a screen refresh is triggered. The issue persists even in a clean CMD environment without any shell customizers like Oh My Posh or Clink.

To Reproduce

  1. Configure an integrated terminal profile with cmd.exe on Windows.
  2. Run an interactive CLI tool that utilizes ANSI escape sequences for in-place UI updates.
  3. Input CJK characters (e.g., "嗨").
  4. The terminal outputs duplicate lines instead of refreshing the current line, leading to a "text explosion" effect.

Expected behavior

The terminal should correctly interpret \r (carriage return) or ANSI cursor movement sequences (e.g., �[1G) to refresh the current line in-place.

Actual behavior

The terminal seems to treat line-refresh commands as line-feed commands, causing the UI and previous prompts to repeat vertically.

Screenshots

[Insert your screenshot here showing the duplicated "嗨" and Gemini CLI responses]

Environment

  • OS: Windows 11
  • Obsidian Version: 1.11.7
  • Plugin Version: 3.21.0
  • Terminal Profile Settings:
"win32IntegratedDefault": {
  "args": [],
  "executable": "C:\\Windows\\System32\\cmd.exe",
  "followTheme": true,
  "name": "",
  "platforms": {
    "win32": true
  },
  "pythonExecutable": "python3",
  "restoreHistory": false,
  "rightClickAction": "copyPaste",
  "successExitCodes": [
    "0",
    "SIGINT",
    "SIGTERM"
  ],
  "terminalOptions": {
    "documentOverride": null
  },
  "type": "integrated",
  "useWin32Conhost": true
}

◇ Ready (Obsidian .html

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions