shift enter newline
What feature would you like to see?
It seems shift+enter for newline may have been implemented in the previous typescript version, but now it has been changed to Ctrl+J. Ctrl+J is already a shortcut in vscode and probably other IDEs too.
Are you interested in implementing this feature?
No response
Additional information
No response
Shift Enter when in regular terminal Ctrl J when in Tmux
Whatever solution ends up being adopted, what's an absolute turn-off is pasting text being unusable: it auto-submits at the first newline character and drops the rest of the text. It's impossible to copy and paste logs onto the terminal.
you guys need enable some sort of bracketed paste... we use ctr-j as an alias to ctr-v ctr-j in our software, but a shift-enter would be simpler than ctr-j for most users, i reckon
Are you all still seeing these issues? I'm on macOS (iTerm) and was able to shift + enter, ctrl + j, and paste multiline text. If so, please share your OS and terminal.
Can't use shift+enter. vscode with bash terminal on ubuntu in a remote container
Hey, @gpeal I'm running the latest MacOS beta + tmux in Ghostty. Outside tmux, shift+enter works normally, but inside a tmux session, only ctrl+j is shown, but I'm already using ctrl+j for moving between panes, so it's a no go for me
Added a 👍 but just wanted to say that I am also in this exact scenario with MacOS stable + tmux in iTerm2.
The solution in claude code is / + Enter to escape the newline. It's not the most intuitive solution in the world, but it works well.
Option+Enter please. macOS Terminal works this way.
Shift + enter, control + enter, or #3049 would be great for me. I'm also running into the issue of Ctrl+J already being an existing, heavily used shortcut in VSCode.
Running codex in tmux in Wezterm on Mac. Shift+Enter runs the command. Cmd+J is my tmux prefix. Would be wonderful not to need to remap just for this.
Yeah, I can't really use ctrl+j in tmux either... Having shift+enter work all the time or let us configure would be nice
A quick fix for now in tmux:
bind -n C-j send-keys C-j
That way tmux forwards Ctrl+J instead of treating it as Enter. However this means you can't go to panes below your codex pane.
Or
# Leader + j sends Ctrl-j to the app
bind j send-keys C-j
As an addition to @idriss-mortadi comment, if you use tmux with the vim-tmux-navigator plugin. You can configure this at the end of your .tmux.conf:
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.config/tmux/plugins/tpm/tpm'
# Important to put this after the run tpm
is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|l?n?vim?x?|fzf)(diff)?$'"
unbind -n C-j
bind -n C-j if-shell "$is_vim" { send-keys C-j } { \
send-keys C-j ; \
select-pane -D \
}
Apply the changes with tmux source-file .tmux.conf
This allows you to use Ctrl+J to do newlines in codex while you can still move to pane below, both in tmux and from neovim.
And if you prefer to use Shift+Enter you can configure that key combination to send Ctrl+J in your terminal (e.g., with Wezterm). This is my config as an example:
local wezterm = require 'wezterm'
local config = {}
-- In case you install it in WSL
-- config.default_domain = 'WSL:Ubuntu'
config.enable_tab_bar = false
config.window_decorations = "RESIZE"
config.font = wezterm.font "UbuntuMono Nerd Font"
config.window_background_opacity = 0.81
config.font_size = 18
config.keys = {
{
key = 'F11',
action = wezterm.action.ToggleFullScreen,
},
-- This is what you need for using "Shift+Enter" in Codex with Wezterm
{
key="Enter",
mods="SHIFT",
action=wezterm.action{SendString="\n"}
},
}
return config
this already works in codex-cli 0.39.0 (test on Mac/iTerm2)
this already works in codex-cli 0.39.0 (test on Mac/iTerm2)
Opt+Enter works now, good. But Shift+Enter still not.
Still no Shift+Enter in IntelliJ IDEA terminal.
this already works in codex-cli 0.39.0 (test on Mac/iTerm2)
Opt+Enter works now, good. But Shift+Enter still not.
alright could be a leftover of Claude Code's /terminal-setup -- I have this entry in my iTerm2's "Key Bindings":
Shift+enter and ctrl+j should both work in the latest versions. Closing this as we haven't seen new reports for a bit and there are plenty of workarounds listed above if you have a particular setup where this happens to unfortunately not work out of the box.
@tibo-openai Problem still exists in v0.47.0. In IntelliJ IDEA terminal. (switched to codex from claude and this problem very annoying)
But they made Alt + Enter work. Have developers ever heard of https://en.wikipedia.org/wiki/Principle_of_least_astonishment !?
I vote for either making it configurable or either Ctrl + Enter or Shift + Enter ( Alt + Enter is first time in my life and I am 34 years with computers).
I am pressing Ctrl + Enter and it start processing partial prompt instead of letting me enter the rest. This is an example how one not very thoughtful decision ruins the entire great product. Or there is a plan to move the entier world to Alt + Enter :)
If you use vscode ssh from windows to remote linux. Add this to keybindings.json
{
"key": "shift+enter",
"command": "workbench.action.terminal.sendSequence",
"args": { "text": "\\\n" },
"when": "terminalFocus"
}