Command reference ยท Cursor CLI
/setup-terminal
Configures terminal newline keybindings to match the detected terminal.
/setup-terminal detects your terminal program and sets up Option+Enter as a way to insert line breaks. According to the doc, iTerm2, Ghostty, Kitty, Warp, and Zed's integrated terminal already come with native support for Shift+Enter โ the command isn't needed there. For Apple Terminal, Alacritty, and VS Code's integrated terminal, it handles the configuration.
In terminal multiplexers like tmux or screen, the command has no effect, because these intercept Shift+Enter themselves; there, according to the doc, Ctrl+J remains the most reliable alternative, working everywhere without configuration.
Those who prefer to set the keys themselves will find manual instructions in the doc โ for example, sending \x1b\r for Option+Enter, with example configurations for iTerm2, Alacritty, and Kitty.
โ WHEN TO USE IT?
Being able to write multi-line prompts
After installing in Apple Terminal, run /setup-terminal once so Option+Enter inserts a line break instead of submitting.
Set up the VS Code terminal
Call /setup-terminal in the integrated VS Code terminal, because according to the doc it doesn't come with native Shift+Enter support.
โ WHEN NOT TO?
The terminal already supports Shift+Enter
iTerm2, Ghostty, Kitty, Warp, and Zed's integrated terminal handle line breaks without setup, according to the doc.
Better: Simply use Shift+Enter.
Working in tmux or screen
Multiplexers intercept Shift+Enter themselves; according to the doc, the command has no effect there.
Better: Use Ctrl+J โ according to the doc, the most reliable alternative.
SOURCES
- Cursor Docs โ Slash Commands โ cursor.com
MORE COMMANDS ยท Cursor CLI