[BUG] Claude Code v2.1.83 breaks my terminal on exit

Status Fixed / completed
Maintainer reply None cached
Activity 7 comments · opened Mar 25, 2026 · closed Mar 26, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

After exiting Claude Code v2.1.83, Ctrl+C, Ctrl+D, Ctrl+L etc. don't work anymore!
Example:

────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
❯ 
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
  Press Ctrl-D again to exit

Resume this session with:
claude --resume a1213c5a-8086-4d4d-8bd4-07b5bf06f947
~ %  00;5u00;5u00;5u00;5u08;5u

What Should Happen?

my terminal should keep working normally after exiting Claude Code

Error Messages/Logs

Steps to Reproduce

exit Claude Code v2.1.83

Claude Model

Opus

Is this a regression?

Yes, this worked in a previous version

Last Working Version

v2.1.81

Claude Code Version

v2.1.83

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Other

Additional Information

using Ghostty

View original on GitHub ↗

7 Comments

github-actions[bot] · 5 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/38625
  2. https://github.com/anthropics/claude-code/issues/38578
  3. https://github.com/anthropics/claude-code/issues/38624

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

Davidonium · 5 months ago

I am running into this too.

OS: MacOS
Terminal: Kitty
Claude Version: v2.1.83

I exited the program with /exit.

jlework · 5 months ago

The issue is also present on Linux.
Edit: on ghostty, terminal can be restored with Menu -> Reset and Ctrl-C afterwards.

Reaomaol · 5 months ago

Same issue here on Linux (Rocky Linux 10, kernel 6.12.0) with Ghostty, running Claude Code inside a Podman container.

Bisect confirmation: Built two identical containers differing only in Claude Code version:

  • v2.1.81: terminal works perfectly after /exit
  • v2.1.83: terminal completely unusable — all keypresses render as literal escape sequences

Additional note: host-side cleanup (stty sane, reset, escape sequence resets) has no effect. The parent wrapper script also appears to be signal-killed on container exit, preventing any post-exit cleanup from running.

dashorst · 5 months ago
yurukusa · 5 months ago

Same root cause as #38761 — Claude Code enables kitty keyboard protocol but does not restore terminal state on exit.
A Stop hook can fix this automatically:

{
  "hooks": {
    "Stop": [{
      "matcher": "",
      "hooks": [{
        "type": "command",
        "command": "printf '\\e[<u\\e[=0u\\e[>0m'"
      }]
    }]
  }
}

This sends the disable sequences for both kitty keyboard protocol (\e[<u, \e[=0u) and modifyOtherKeys (\e[>0m) on every session exit.

github-actions[bot] · 4 months ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.