diff --git a/dist/windows.zip b/dist/windows.zip index 1736b8f..d1f737b 100644 Binary files a/dist/windows.zip and b/dist/windows.zip differ diff --git a/package.json b/package.json index 1176bff..4784515 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@merrymake/cli", - "version": "1.6.7", + "version": "1.6.8", "description": "", "main": "index.js", "scripts": { diff --git a/prompt.js b/prompt.js index cb95ba1..2ce40e1 100644 --- a/prompt.js +++ b/prompt.js @@ -288,7 +288,8 @@ function shortText(prompt, description, defaultValueArg) { output(beforeCursor + afterCursor); moveCursor(-afterCursor.length, 0); } - else if (k === exports.DELETE && afterCursor.length > 0) { + else if ((k === exports.DELETE || k.charCodeAt(0) === 127) && + afterCursor.length > 0) { moveCursor(-beforeCursor.length, 0); afterCursor = afterCursor.substring(1); node_process_1.stdout.clearLine(1); @@ -302,7 +303,7 @@ function shortText(prompt, description, defaultValueArg) { output(beforeCursor + afterCursor); moveCursor(-afterCursor.length, 0); } - else if (/^[A-Za-z0-9@_, .-/:;#=&*?]+$/.test(k)) { + else if (/^[A-Za-z0-9@_, .-/:;#=&*?+]+$/.test(k)) { moveCursor(-beforeCursor.length, 0); beforeCursor += k; node_process_1.stdout.clearLine(1); diff --git a/prompt.ts b/prompt.ts index 8202f4a..08f940b 100644 --- a/prompt.ts +++ b/prompt.ts @@ -313,7 +313,10 @@ export function shortText( stdout.clearLine(1); output(beforeCursor + afterCursor); moveCursor(-afterCursor.length, 0); - } else if (k === DELETE && afterCursor.length > 0) { + } else if ( + (k === DELETE || k.charCodeAt(0) === 127) && + afterCursor.length > 0 + ) { moveCursor(-beforeCursor.length, 0); afterCursor = afterCursor.substring(1); stdout.clearLine(1); @@ -325,7 +328,7 @@ export function shortText( stdout.clearLine(1); output(beforeCursor + afterCursor); moveCursor(-afterCursor.length, 0); - } else if (/^[A-Za-z0-9@_, .-/:;#=&*?]+$/.test(k)) { + } else if (/^[A-Za-z0-9@_, .-/:;#=&*?+]+$/.test(k)) { moveCursor(-beforeCursor.length, 0); beforeCursor += k; stdout.clearLine(1);