diff --git a/components/REPL/REPLInput.tsx b/components/REPL/REPLInput.tsx index df59dfa..033a32e 100644 --- a/components/REPL/REPLInput.tsx +++ b/components/REPL/REPLInput.tsx @@ -83,6 +83,10 @@ const REPLInput: NextPage = ({historyCallback, historyClear, in case e.key === "Enter": { e.preventDefault(); const command = (e.target as HTMLInputElement).value.trim(); + if (command.length === 0) { + historyCallback(["$"]); + return; + } if (cmdHistory.at(-1) !== command) setCmdHistory(cmdHistory.concat([command]).splice(0, 100)); clearInput(input); setInCmdHistory(-1);