Skip to content

Commit 308eeff

Browse files
committed
Fix for Enter on Linux
1 parent 345df5a commit 308eeff

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

cli/src/components/multiline-input.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -510,6 +510,7 @@ export const MultilineInput = forwardRef<
510510
const hasBackslashBeforeCursor =
511511
cursorPosition > 0 && value[cursorPosition - 1] === '\\'
512512

513+
// Plain Enter: no modifiers, sequence is '\r' (macOS) or '\n' (Linux)
513514
const isPlainEnter =
514515
isEnterKey &&
515516
!key.shift &&
@@ -518,10 +519,9 @@ export const MultilineInput = forwardRef<
518519
!key.option &&
519520
!isAltLikeModifier &&
520521
!hasEscapePrefix &&
521-
key.sequence === '\r' &&
522+
(key.sequence === '\r' || key.sequence === '\n') &&
522523
!hasBackslashBeforeCursor
523-
const isShiftEnter =
524-
isEnterKey && (Boolean(key.shift) || key.sequence === '\n')
524+
const isShiftEnter = isEnterKey && Boolean(key.shift)
525525
const isOptionEnter =
526526
isEnterKey && (isAltLikeModifier || hasEscapePrefix)
527527
const isBackslashEnter = isEnterKey && hasBackslashBeforeCursor

0 commit comments

Comments
 (0)