Clear input (ctrl u/c)
This commit is contained in:
parent
cf17d56f76
commit
e903128069
@ -53,6 +53,7 @@ const REPLInput: NextPage<REPLInputParams> = ({historyCallback, historyClear, in
|
|||||||
if(typed.current) typed.current.innerHTML = currentCmd[justTabbed % currentCmd.length];
|
if(typed.current) typed.current.innerHTML = currentCmd[justTabbed % currentCmd.length];
|
||||||
if(completion.current) completion.current.innerHTML = "";
|
if(completion.current) completion.current.innerHTML = "";
|
||||||
setJustTabbed(justTabbed + 1);
|
setJustTabbed(justTabbed + 1);
|
||||||
|
return false;
|
||||||
} else setJustTabbed(0);
|
} else setJustTabbed(0);
|
||||||
|
|
||||||
if (e.key === "Enter") {
|
if (e.key === "Enter") {
|
||||||
@ -66,6 +67,7 @@ const REPLInput: NextPage<REPLInputParams> = ({historyCallback, historyClear, in
|
|||||||
const result = executeCommand(command);
|
const result = executeCommand(command);
|
||||||
clearInput(input);
|
clearInput(input);
|
||||||
historyCallback(result);
|
historyCallback(result);
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (e.key === "d" && e.ctrlKey) {
|
if (e.key === "d" && e.ctrlKey) {
|
||||||
@ -73,15 +75,22 @@ const REPLInput: NextPage<REPLInputParams> = ({historyCallback, historyClear, in
|
|||||||
const result = executeCommand("exit");
|
const result = executeCommand("exit");
|
||||||
clearInput(input);
|
clearInput(input);
|
||||||
historyCallback(result);
|
historyCallback(result);
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (e.key === "l" && e.ctrlKey) {
|
if (e.key === "l" && e.ctrlKey) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
clearInput(input);
|
clearInput(input);
|
||||||
historyClear();
|
historyClear();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((e.key === "c" || e.key === "u") && e.ctrlKey) {
|
||||||
|
e.preventDefault();
|
||||||
|
clearInput(input);
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
return <div className={styles.wrapperwrapper}>
|
return <div className={styles.wrapperwrapper}>
|
||||||
|
Loading…
Reference in New Issue
Block a user