File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -210,10 +210,6 @@ function inputToString(input: Buffer | string): string {
210210 }
211211}
212212
213- function splitTextToken ( value : string ) : string [ ] {
214- return value . match ( / \r \n | [ \r \n ] | [ ^ \r \n ] + / g) ?? [ ]
215- }
216-
217213export function parseMultipleKeypresses (
218214 prevState : KeyParseState ,
219215 input : Buffer | string | null = '' ,
@@ -282,9 +278,7 @@ export function parseMultipleKeypresses(
282278 const mouse = parseMouseEvent ( resynthesized )
283279 keys . push ( mouse ?? parseKeypress ( resynthesized ) )
284280 } else {
285- for ( const chunk of splitTextToken ( token . value ) ) {
286- keys . push ( parseKeypress ( chunk ) )
287- }
281+ keys . push ( parseKeypress ( token . value ) )
288282 }
289283 }
290284 }
@@ -704,9 +698,11 @@ function parseKeypress(s: string = ''): ParsedKey {
704698 return createNavKey ( s , 'mouse' , false )
705699 }
706700
707- if ( s === '\r' || s === '\n' || s === '\r\n' ) {
701+ if ( s === '\r' ) {
708702 key . raw = undefined
709703 key . name = 'return'
704+ } else if ( s === '\n' ) {
705+ key . name = 'enter'
710706 } else if ( s === '\t' ) {
711707 key . name = 'tab'
712708 } else if ( s === '\b' || s === '\x1b\b' ) {
You can’t perform that action at this time.
0 commit comments