Skip to content

Status line leaves ─ artifacts in terminal after Ctrl+C exit #107

@AmethystLiang

Description

@AmethystLiang

Description

When exiting Claude Code with Ctrl+C, the ccline status line's box-drawing characters () are left behind in the terminal output, creating a visual artifact on the prompt line.

Steps to reproduce

  1. Configure ccline as Claude Code's status line in ~/.claude/settings.json:
    "statusLine": {
        "type": "command",
        "command": "/path/to/ccline",
        "padding": 0
    }
  2. Start a Claude Code session
  3. Press Ctrl+C to cancel/exit

Expected behavior

Terminal returns to a clean prompt with no leftover characters.

Actual behavior

The prompt line shows ^C followed by a long line of characters extending to the terminal edge:

$ ^C────────────────────────────────────────
$

Environment

  • ccline v1.1.2
  • macOS (Darwin, arm64)
  • Bash shell
  • iTerm2 terminal

Analysis

It appears that when Claude Code's process receives SIGINT, ccline doesn't get a chance to clear its rendered status line from the terminal. The fill characters that normally form the status bar background get dumped into the visible terminal output.

A possible fix would be to install a SIGINT/SIGTERM handler in ccline that writes the appropriate terminal escape sequences (e.g., \033[2K\r to clear the line) before exiting.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions