Bug Report: Gemini-CLI Line Break Issue
What happened?
I attempted to create line breaks in gemini-cli using Shift + Enter and \n in my input prompts, but neither method worked as expected. When I pressed Shift + Enter, the command was submitted instead of adding a new line. Additionally, using \n in the input did not result in proper line breaks in the output, causing formatting issues. This behavior persists across multiple attempts with multi-line prompts or code inputs.
What did you expect to happen?
I expected Shift + Enter to insert a new line without submitting the command, similar to other CLI tools. Alternatively, I anticipated that including \n in the input would generate correct line breaks in the output, ensuring proper formatting for multi-line text or code.
Client information
v0.1.7 Windows11
Login information
No response
Anything else we need to know?
No response
Due to terminal limitations, you can't use Shift+Enter or Ctrl+Enter for line breaks. To insert a line break, please type a backslash followed by Enter.
@yusei-murai Thanks for this. It works but I swear SHIFT+ENTER was working yesterday as I did it countless times. I'm running Rovo side-by-side with Gemini & Gemini was working with SHIFT+ENTER just 2-3 days ago but I love \+Enter too although a bit unintuitive.
Well that works in claude code just fine - why can't gemini cli make it work?
/help should list the working methods of creating a newline, but there is also an open issue to make shift+enter work.
Closing as duplicate. If you think this is a different problem, please reopen with more clarifications. Thanks!
Still the shift+enter not working.
Still the
shift+enternot working.
Correct, there's an open bug for this, which I've linked: #849
Due to terminal limitations, you can't use Shift+Enter or Ctrl+Enter for line breaks. To insert a line break, please type a backslash followed by Enter.
This method DOES NOT WORK In the latest version:0.1.10.
Due to terminal limitations, you can't use Shift+Enter or Ctrl+Enter for line breaks. To insert a line break, please type a backslash followed by Enter.
This method DOES NOT WORK In the latest version:0.1.10.
Yes, I confirm that [\ ENTER] for new line is gone in the new update. Shift Enter, Ctrl Enter also not working
try Ctrl+j
@gjf7 thanks for your answer. ctrl+J works, but it is uppercase J
(macosx)
Ctrl+j (lowercase) is working in ubuntu linux
It is not working on powershell (ctrl+j, ctrl+J, shift+ENTER, ctrl+ENTER, \ followed by ENTER). None of these works.
It is not working on powershell (ctrl+j, ctrl+J, shift+ENTER, ctrl+ENTER, \ followed by ENTER). None of these works.
None of these works in mac too.
control+j is working on macOs.
Alt+Enter is working on Ubuntu
Alt+Enter is also working on Windows 11 with WSL-connected gemini-cli (e.g. within VScode)
@yusei-murai
Due to terminal limitations, you can't use Shift+Enter or Ctrl+Enter for line breaks. To insert a line break, please type a backslash followed by Enter.
I'm not sure this is entirely true. For me, in Claude Code, Shift + Enter worked for newlines out of the box (I didn't have to change any settings or anything). Clearly it can be done. Maybe it's a quirk of my particular setup? I use Warp.
Since this is such a common use case it would be great in the meantime to have this above the prompt, or as a placeholder when the prompt is empty, or as one of those purple loading 'jokes'. There's probably a heap of useful stuff you could put there which would really improve the ways user are able to interact with the product.