Claude Code and Kitty Terminal
Getting multi-line input to work properly when using Claude Code in Kitty terminal requires a simple configuration change.
When using Claude Code in Visual Studio Code integrated terminal, it offers the /terminal-setup
command which enables pressing shift+enter
for a newline character. This happens because VS Code's integrated terminal has built-in handling for multi-line input, while Kitty terminal requires explicit configuration.
Kitty Keypress Mapping
We can add keypress mappings with kitty and use a condition to ensure the mapping only activates when desired, preventing conflicts with other terminal applications.
map --when-focus-on title:claude shift+enter send_text normal,application \\\n
To understand the mapping:
--when-focus-on title:claude
- Only activate when window title contains "claude"shift+enter
- The key combination to mapsend_text normal,application
- Send text to both normal and application modes\\\n
- Send a backslash followed by newline (line continuation defined by Claude Code)
Steps
- Open your
kitty.conf
(e.g.~/.config/kitty/kitty.conf
) - Add the following command anywhere in the file (I chose the top since the default config is massive)
map --when-focus-on title:claude shift+enter send_text normal,application \\\n
- Restart kitty or reload your settings (
ctrl+shift+f5
) - Open Claude Code and press
shift+enter
🎉
Troubleshooting
If the mapping doesn't work, you can try these alternatives:
- Use
title:*claude*
for broader matching:map --when-focus-on title:*claude* shift+enter send_text normal,application \\\n
- Use
cmdline:claude
for matching the commandmap --when-focus-on cmdline:claude shift+enter send_text normal,application \\\n
For more advanced matching criteria, see the Kitty configuration documentation.