anthropics / anthropics/claude-code

[BUG] Stale TUI frame remains on screen after /exit until `clear`/`reset` (Konsole, xterm-256color)

Open
#88,920 0 comments 0 reactions 0 assignees View on GitHub
area:tui bug platform:linux
Dominant language
Python
Stars
145k
Forks
23.1k
PR merge metrics
PR metrics pending

Description

### Preflight Checklist

- [x] I have searched [existing issues](https://github.com/anthropics/claude-code/issues?q=is%3Aissue%20state%3Aopen%20label%3Abug) 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 running exit in the Claude Code CLI, the TUI's rendered screen stays visible and unresponsive to input, even though no claude process is still running. Running clear or reset in the terminal immediately fixes it, suggesting the alternate-screen-buffer restore sequence isn't being sent/processed on exit.

### What Should Happen?

Terminal should return cleanly to the normal shell prompt on exit, with no leftover frame.

### Error Messages/Logs

```shell

```

### Steps to Reproduce

a. Run claude in Konsole
b. Interact normally, then run /exit
c. Observe the CLI's screen/UI remains rendered and inert
d. Run clear (or reset) — screen clears to normal prompt

### Claude Model

None

### Is this a regression?

I don't know

### Last Working Version

_No response_

### Claude Code Version

2.1.241 (Claude Code)

### Platform

Anthropic API

### Operating System

Ubuntu/Debian Linux

### Terminal/Shell

Xterm

### Additional Information

_No response_

Contributor guide

No contributing guide indexed for this repository

Research direction

No source file or test is named in the report. Reproduce the exit flow in Konsole with xterm-256color, then trace the CLI exit path and terminal cleanup behavior; done means /exit restores the normal shell prompt without a stale, inert frame and clear or reset is no longer needed.

Written by the indexing model from the issue text.

Assessment

Tech stack
linux, python
Domain
cli, operating-systems
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.