Update ctrl+c hotkey to print current text to terminal without executing it to mimic real terminal behavior

This commit is contained in:
James Villegas 2022-07-07 08:11:34 +08:00
parent 6c026e6d5c
commit 6d8a3e192b

@ -324,6 +324,7 @@ export function TerminalInput({ terminal, router, player }: IProps): React.React
if (Settings.EnableBashHotkeys) { if (Settings.EnableBashHotkeys) {
if (event.code === KEYCODE.C && event.ctrlKey && ref && ref.selectionStart === ref.selectionEnd) { if (event.code === KEYCODE.C && event.ctrlKey && ref && ref.selectionStart === ref.selectionEnd) {
event.preventDefault(); event.preventDefault();
terminal.print(`[${player.getCurrentServer().hostname} ~${terminal.cwd()}]> ${value}`);
modifyInput("clearall"); modifyInput("clearall");
} }