Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions packages/app/src/components/prompt-input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1191,8 +1191,10 @@ export const PromptInput: Component<PromptInputProps> = (props) => {
}

// Handle Shift+Enter BEFORE IME check - Shift+Enter is never used for IME input
// and should always insert a newline regardless of composition state
if (event.key === "Enter" && event.shiftKey) {
// and should always insert a newline regardless of composition state.
// On Windows, IME may report event.key as "Process" instead of "Enter" during
// composition, so we also check event.code which reflects the physical key.
if ((event.key === "Enter" || event.code === "Enter") && event.shiftKey) {
addPart({ type: "text", content: "\n", start: 0, end: 0 })
event.preventDefault()
return
Expand Down
Loading