fix: add proper Shift+Enter and Ctrl+J newline handling (#871)#875
fix: add proper Shift+Enter and Ctrl+J newline handling (#871)#875dgageot merged 1 commit intodocker:mainfrom
Conversation
43cab7e to
7fe49fc
Compare
|
@rockygeekz could you tell the user which key stroke to use? |
…ocker#871) Signed-off-by: Rakesh S <rakesh.s552004@gmail.com>
7fe49fc to
f250123
Compare
|
@dgageot Behavior works as expected, and the UI now looks like this (see the image).
|
|
Just got time to look at this, we should do this differently, bubbletea has some things that can help us for this, it's weird and hidden but here's how it looks. We should, in the tui.go (maybe?) listen to the event We should set the keyboard shortcuts dynamically so that we always have only one shortcut for newlines at any time. If you are on a mac you can test both cases easily: the default terminal doesn't support keyboard enhancements, while iterm does. Not sure how you would test this on a Windows machine... |
|
@rumpl I'm going to merge this one and improve the implementation in another PR |
|
Hi @dgageot Thanks for merging! I wasn’t able to test the mac/iTerm side, but hope the contribution was helpful. |
Hey @rumpl, can u give a read to my thoughts here #930 once. Thanks !! |

Hey!
This PR adds the right behavior for Enter, Shift+Enter, and Ctrl+J as discussed in issue #871.
Enter now submits the message
Shift+Enter adds a newline (when the terminal actually sends that key)
Ctrl+J always adds a newline as a fallback on terminals that don’t support Shift+Enter
I tested this in a couple of environments:
Ubuntu terminal → Shift+Enter works and inserts a newline
WSL/Windows Terminal → Shift+Enter isn’t detected, but Ctrl+J works as expected
This follows the guidance you mentioned:
“use shift-enter when possible, and ctrl-j otherwise.”
If you want me to adjust anything or add more tests, I’m happy to update it!