From dcbfdbb12ebd86850cd73401782c51bc46e054d8 Mon Sep 17 00:00:00 2001 From: Lucas Colombo Date: Sun, 2 Oct 2022 21:42:11 -0300 Subject: [PATCH] fix: input malfunction when pasting multiline text ref: #8 closes: #8 --- src/components/input/core/key-control.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/input/core/key-control.ts b/src/components/input/core/key-control.ts index daec0cc..7cf9c88 100644 --- a/src/components/input/core/key-control.ts +++ b/src/components/input/core/key-control.ts @@ -149,6 +149,7 @@ export function handleInput( // do nothing } else if (e.input) { // any other input + e.input = e.input?.replace('\r\n', '\n'); const ansiStripped = stripAnsi(e.input); const nextValue = value.slice(0, cursor) + ansiStripped + value.slice(cursor);