Hyper terminal (powered by xterm.js) sends the same byte (\r, carriage return) for both Enter and Shift+Enter. This means Shift+Enter can't insert a newline in Claude Code's multi-line input - it just submits instead.
Other terminals like iTerm2, Kitty, Ghostty, and Alacritty either handle this natively or have simple config options. Hyper doesn't, but a small local plugin fixes it.
Create a local Hyper plugin that intercepts Shift+Enter and sends \n (line feed, 0x0A) to the PTY instead of \r.
mkdir -p ~/.hyper_plugins/local/hyper-shift-enterSave this as ~/.hyper_plugins/local/hyper-shift-enter/index.js:
module.exports = {
decorateTerm(Term, { React }) {
return class extends React.Component {
constructor(props) {
super(props);
this._onDecorated = this._onDecorated.bind(this);
}
_onDecorated(term) {
if (this.props.onDecorated) this.props.onDecorated(term);
if (!term || !term.term) return;
const uid = this.props.uid;
term.term.attachCustomKeyEventHandler((e) => {
if (e.type === 'keydown' && e.key === 'Enter' && e.shiftKey) {
e.preventDefault();
// Send LF (0x0A) to PTY - this is what Claude Code expects for newline
window.rpc.emit('data', { uid, data: '\n' });
return false;
}
return true;
});
}
render() {
return React.createElement(Term, Object.assign({}, this.props, {
onDecorated: this._onDecorated,
}));
}
};
},
};Add "hyper-shift-enter" to localPlugins:
localPlugins: ["hyper-shift-enter"],Press Cmd+Shift+R (macOS) or restart Hyper.
- xterm.js's
attachCustomKeyEventHandlerintercepts Shift+Enter before xterm processes it - Instead of the default
\r(submit), it sends\n(line feed) to the shell PTY via Hyper's RPC - Claude Code (and other tools using raw terminal input) interprets
\nas "insert newline" rather than "submit"
- Any CLI tool that distinguishes
\nfrom\rfor multi-line input - Bash line continuation (though for that you may prefer typing
\+ Enter manually)
- claude-code #1259: Support Shift+Enter for multiline input
- claude-code #9321: Shift+Enter doesn't insert newline in CLI
- claude-code #2754: Shift+Enter doesn't work after /setup-terminal
- Ghostty:
keybind = shift+enter=text:\nin config - Alacritty:
{ key = "Return", mods = "Shift", chars = "\n" }in alacritty.toml - Kitty: Works out of the box (Kitty keyboard protocol)
- iTerm2/WezTerm: Works out of the box (natively sends
\nfor Shift+Enter)