shift enter newline

Resolved 💬 21 comments Opened Aug 15, 2025 by matssk Closed Oct 19, 2025
💡 Likely answer: A maintainer (gpeal, contributor) responded on this thread — see the highlighted reply below.

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_

View original on GitHub ↗

21 Comments

shanecowherd · 11 months ago

Shift Enter when in regular terminal
Ctrl J when in Tmux

Zamaroht · 11 months ago

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.

mountaineerbr · 11 months ago

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

gpeal contributor · 11 months ago

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.

matssk · 10 months ago

Can't use shift+enter. vscode with bash terminal on ubuntu in a remote container

panzacoder · 10 months ago
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.

m-emelchenkov · 10 months ago

Option+Enter please. macOS Terminal works this way.

alliepiper · 10 months ago

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.

flowerornament · 10 months ago

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.

idriss-mortadi · 10 months ago
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.

idriss-mortadi · 10 months ago

Or

# Leader + j sends Ctrl-j to the app
bind j send-keys C-j
aams-eam · 10 months ago

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
youurayy · 10 months ago

this already works in codex-cli 0.39.0 (test on Mac/iTerm2)

m-emelchenkov · 10 months ago
this already works in codex-cli 0.39.0 (test on Mac/iTerm2)

Opt+Enter works now, good. But Shift+Enter still not.

alexeydubinin · 9 months ago

Still no Shift+Enter in IntelliJ IDEA terminal.

youurayy · 9 months ago
> 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":

<img width="564" height="200" alt="Image" src="https://github.com/user-attachments/assets/0e24f7a9-2911-49e8-bde5-2459e31b2fde" />

tibo-openai collaborator · 9 months ago

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.

alexeydubinin · 9 months ago

@tibo-openai Problem still exists in v0.47.0.
In IntelliJ IDEA terminal. (switched to codex from claude and this problem very annoying)

dmugtasimov · 8 months ago

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 :)

zzhixin · 6 months ago

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"
    }
winter-loo · 5 months ago

IMHO, gemini is doing the correct way. All shortcuts are not fit in my working environment(Shift+Enter/Opt+Enter/Ctrl+Enter/Ctrl+J). Gemini allows me to input a '\\' at the end of line and enter.