MCPcopy Index your code
hub / github.com/CodebuffAI/codebuff / isPlainEnterKey

Function isPlainEnterKey

cli/src/utils/terminal-enter-detection.ts:27–42  ·  view source on GitHub ↗
(key: EnterDetectionKey)

Source from the content-addressed store, hash-verified

25}
26
27export function isPlainEnterKey(key: EnterDetectionKey): boolean {
28 // Some local interceptors consume Enter before the global keyboard hooks see
29 // it, so record non-keypad Return here before consulting the linefeed fallback.
30 markReturnKeySeenForKey(key)
31
32 return (
33 (key.name === 'return' ||
34 key.name === 'enter' ||
35 isKeypadEnter(key) ||
36 (key.name === 'linefeed' && isLinefeedActingAsEnter())) &&
37 !key.shift &&
38 !key.ctrl &&
39 !key.meta &&
40 !key.option
41 )
42}
43
44export function markReturnKeySeen(): void {
45 hasSeenReturnKey = true

Callers 11

PublishContainerFunction · 0.90
SessionEndedBannerFunction · 0.90
ProjectPickerScreenFunction · 0.90
ChatHistoryScreenFunction · 0.90
FeedbackTextSectionFunction · 0.90
ReviewScreenFunction · 0.90
MultipleChoiceFormFunction · 0.90
useLoginKeyboardHandlersFunction · 0.90

Calls 3

isKeypadEnterFunction · 0.90
markReturnKeySeenForKeyFunction · 0.85
isLinefeedActingAsEnterFunction · 0.85

Tested by

no test coverage detected