Avoid clearing the terminal scrollback
There's a few instances where Claude Code will clear the terminal automatically and delete all scrollback.
- When resizing the terminal.
- With the
/clearcommand. - When switching to detailed transcript.
None of these should clear the user's terminal scrollback.
If Claude Code needs more control of the terminal history it should operate in the alternate screen. Perhaps the alternate screen is only needed for the detailed transcript, I actually thought this was the way it worked originally, I don't know if it was changed at some point or I hallucinated it.
This would be helpful for a variety of use cases:
- Want to clear the context without losing my chat history
- Was doing work in the terminal before opening claude
- Moving the terminal (obviously haha)
This would be great to make the context of claude separate from the context of my window.
Ctrl+L doesn't properly clear the terminal, and /clear clears the context.
~CMD+K and then press ESC cleared the console in pycharm for me on MAC (prevents the annoying scroll issues when the terminal histroy gets too long) without clearing the current context.~
nevermind, the history just reappears after it begins to scroll again.
The is surely the number 1 most important Issue. I've also found that scrollback all gets deleted when I use Ctrl-G to edit the prompt in Vim, and then exit vim.
please fix this!!! this is f**king annoying...!!!
Its really really bad DX, this should be fixed, losing important context is not acceptable