gemini-cli icon indicating copy to clipboard operation
gemini-cli copied to clipboard

Shift+Enter not adding new line

Open Adverbly opened this issue 1 year ago • 13 comments

What happened?

I press Shift + Enter and it submits my text as if I wasn't pressing Shift.

What did you expect to happen?

Shift+Enter would add a new line

Client information

$ gemini /about
╭─────────────────────────────────────────────────────────────────────────────────────────────────╮
│                                                                                                 │
│ About Gemini CLI                                                                                │
│                                                                                                 │
│ CLI Version                      0.1.3                                                          │
│ Git Commit                       382486e (local modifications)                                  │
│ Model                            gemini-2.5-pro                                                 │
│ Sandbox                          no sandbox                                                     │
│ OS                               linux                                                          │
│                                                                                                 │

Some more information: I'm on PopOS 22 using Alacritty and tmux

Login information

Licensed code assist user

Anything else we need to know?

Workaround is to use

Ctrl + j

Adverbly avatar Jun 26 '25 03:06 Adverbly

Interesting - haven't seen that on *nix. #1699 details a macOS issue but I'll leave this open for this OS.

markmcd avatar Jun 26 '25 05:06 markmcd

I also ran into this issue. Upon some further testing I also noticed that Xterm-style CSI sequences aren't interpreted for shift+enter (in modern terminals like ghostty)

upon pressing shift+enter:

╭─────────────────────────╮
│ > [27;2;13~             │
╰─────────────────────────╯

Perhaps interpreting these control sequences can be added?

gitmpr avatar Jun 26 '25 09:06 gitmpr

I'm having the same issue, but interestingly, it arises only when I launch the terminal in VSCode, but not in iTerm2.

FYI, I'm using:

  • gemini-cli, 0.1.4
  • zsh 5.9 (arm-apple-darwin23.0.0)
  • vscode 1.101.2
  • iterm2 3.5.14

itsmevictor avatar Jun 26 '25 10:06 itsmevictor

I have the same problem, using:

  • Fish 4.0.2
  • Gemini 0.1.4

tonisole avatar Jun 26 '25 11:06 tonisole

Same issue:

  • Win10 1904 Windows Terminal
  • PowerShell 7.5.0

kurwactionary avatar Jun 26 '25 13:06 kurwactionary

use ALT+ENTER

ACCGAGTT avatar Jun 26 '25 15:06 ACCGAGTT

@ACCGAGTT Hi is Alt + Enter for Windows Terminal? Does Shift + Enter not work on Windows terminal/powershell for you?

devpool007 avatar Jun 26 '25 15:06 devpool007

@ACCGAGTT Hi is Alt + Enter for Windows Terminal? Does Shift + Enter not work on Windows terminal/powershell for you?

i have mine installed on RHEL10 terminal with bash-it , did not try it on Windows just yet. If you like i can test

ACCGAGTT avatar Jun 26 '25 15:06 ACCGAGTT

@ACCGAGTT Ah ok but Shift + Enter doesn't work on RHEL10 either for you? Yupp if you can test on Windows too that'd be great!

devpool007 avatar Jun 26 '25 15:06 devpool007

@ACCGAGTT Ah ok but Shift + Enter doesn't work on RHEL10 either for you? Yupp if you can test on Windows too that'd be great!

correct shift+enter is non functional on RHEL

ACCGAGTT avatar Jun 26 '25 15:06 ACCGAGTT

@ACCGAGTT Hmm I assume then maybe it is a linux issue? Since the original issue was in Pop OS and you say in Red Hat it's the same

devpool007 avatar Jun 26 '25 15:06 devpool007

WezTerm on macos toggles maximizing the window with alt-enter. Working alternatives are alt-shift-enter, alt-cmd-enter and ctrl-J.

aschoettler avatar Jun 27 '25 01:06 aschoettler

add the following to your Wezterm config to unbind alt-enter

config.keys = {
	{
		key = "Enter",
		mods = "ALT",
		action = wezterm.action.DisableDefaultAssignment,
	},
}

dougbacelar avatar Jun 29 '25 06:06 dougbacelar