Shell startup command from ~/.zshenv rendered into Claude Code's input box on every new terminal session
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?
Every new Claude Code session, opened in a fresh terminal window, shows the
same line pre-filled in the message input box, sitting unsent with the cursor at the end:
source /Users/<user>/<project>/.venv/bin/activate
It is always this exact line, verbatim, regardless of what message was
actually last sent in the app — it does not vary with conversation history. This rules out
a "restore last sent message" explanation.
What Should Happen?
The input box should start empty regardless of what the underlying shell
executes on startup — shell startup output/commands should never leak into Claude Code's
own compose UI.
Error Messages/Logs
Steps to Reproduce
Steps to reproduce:
- Have a
.venvin a project directory, with a shell rc file that auto-sources
.venv/bin/activate unconditionally on shell startup
- Open a new terminal window in that project directory and start a Claude Code session
- The message input box comes pre-filled with the exact
source .../activateline,
unsent, cursor at the end
Claude Model
None
Is this a regression?
No, this never worked
Last Working Version
_No response_
Claude Code Version
2.1.218
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
_No response_