[BUG] /terminal-setup does not work from inside tmux
Open 💬 20 comments Opened Aug 18, 2025 by dlee
Environment
- Platform (select one):
- [ ] Anthropic API
- [ ] AWS Bedrock
- [ ] Google Vertex AI
- [x] Other: claude code
- Claude CLI version: 1.0.83 (Claude Code)
- Operating System: macOS 15.6
- Terminal: iTerm2, tmux
Bug Description
The /terminal-setup slash command is unavailable if run from within tmux.
Steps to Reproduce
- Launch
tmuxin iTerm2 - From within a tmux pane, launch
claude - Run
/terminal-setupfrom within claude
Expected Behavior
/terminal-setup should run like normal and shift-enter should input a newline.
Actual Behavior
/terminal-setup is not detected as a slash command and shift-enter does not input a newline.
Additional Context
tmux is being run from within iTerm2. The workaround is to launch claude from outside of tmux first and running /terminal-setup there. Subsequent uses of claude from within tmux should then be able to use shift-enter as newline input.
20 Comments
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
On macOS...
Within tmux, the
LC_TERMINALenvironment variable is set toiTerm2:And the
TERM_PROGRAMenvironment variable is set totmux:Outside of tmux, the
TERM_PROGRAMenvironment variable is set toiTerm.app:Claude Code should likely inspect both
On macOS, you can workaround this by doing
This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.
ping
I have a similar issue with Shift+Enter and tmux in Kitty and Ghostty.
/terminal-setupnow shows in those terminals with tmux as of v2.1.9 but Shift+Enter does nothing in a tmux session although it does add the newline outside of tmux.Confirm same issue with Kitty in tmux (no issue outside tmux).
Update: actually, it's not a Claude Code issue but a terminal/tmux compatibility issue.
A quick search surfaced this post which provides a solution.
For kitty, you can add this to your
~/.config/kitty/kitty.conf:And voilà, shift+Enter enabled in Claude Code.
Same here, but with ITerm2 , it doesn't work 👎
The proposed workaround did not work but this wrapper function did:
claude() { TERM_PROGRAM=iTerm.app command claude "$@"; }THank you!!!!
For anyone else who uses more than just iTerm and only wants this for iTerm+tmux and leave other apps alone, I put this in my tmux.conf
And in my .zshrc:
In my case with ghostty + tmux I added this line to my tmux config
Might have side effects I didn't expect but at least the problem was solved.
tmux3.6a , iterm2, Shift-Enter just submitted the prompt instead of newline in Claude CLI
Tried all ways Claude suggested but no luck.
Greate, this solved the problem for me with Ghostty and tmux. Thanks
None of the above worked for me (iTerm2 3.6.6, tmux 3.6a) but this post on Reddit worked. Quoting here for convenience:
Edit: Claude suggested a similar fix if you want Option-Left and Option-Right to skip over words (like readline M-b and M-f): map them to
0x1b 0x62and0x1b 0x66respectively. Can confirm it works on my setup.I just use Ctrl + j in tmux, it behave the same way as shift + enter, or you can set the key-bind for tmux in
.tmux.conf:bind-key -T root S-Enter send-keys C-jAdding this to my tmux config not only fixed Shift+Enter, but also fixed Cmd+V paste:
for ghostty+tmux on mac connecting to claude session in remote server through ssh, cmd+enter works.
Thanks, this worked in tmux in iTerm 2 on macOS.
https://code.claude.com/docs/en/terminal-config#configure-tmux
Will allow S-Enter (and Cmd-V -- paste block, different than raw input) behavior in tmux.
@mcint tried that and S-Enter still doesn't work on Kitty+tmux