From 195dff7c4493f0ad66c22c907237d9c6ce35c6ac Mon Sep 17 00:00:00 2001 From: Olivier Gagnon Date: Thu, 16 Sep 2021 21:03:14 -0400 Subject: [PATCH] fix not being able to ctrlc the terminal --- src/Terminal/ui/TerminalInput.tsx | 4 ++-- src/Terminal/ui/TerminalRoot.tsx | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Terminal/ui/TerminalInput.tsx b/src/Terminal/ui/TerminalInput.tsx index dc3144c74..3934a08d9 100644 --- a/src/Terminal/ui/TerminalInput.tsx +++ b/src/Terminal/ui/TerminalInput.tsx @@ -140,9 +140,9 @@ export function TerminalInput({ terminal, engine, player }: IProps): React.React useEffect(() => { function keyDown(this: Document, event: KeyboardEvent): void { if (terminal.contractOpen) return; + if (event.metaKey || event.ctrlKey) return; const ref = terminalInput.current; if (ref) ref.focus(); - // Cancel action if (event.keyCode === KEY.C && event.ctrlKey) { terminal.finishAction(player, true); @@ -351,7 +351,7 @@ export function TerminalInput({ terminal, engine, player }: IProps): React.React className: classes.input, startAdornment: ( <> - + [{player.getCurrentServer().hostname} ~{terminal.cwd()}]>  diff --git a/src/Terminal/ui/TerminalRoot.tsx b/src/Terminal/ui/TerminalRoot.tsx index bb85fd71c..00d020634 100644 --- a/src/Terminal/ui/TerminalRoot.tsx +++ b/src/Terminal/ui/TerminalRoot.tsx @@ -62,7 +62,7 @@ export function TerminalRoot({ terminal, engine, player }: IProps): React.ReactE const hook = scrollHook.current; if (hook !== null) { - setTimeout(() => hook.scrollIntoView(true), 10); + setTimeout(() => hook.scrollIntoView(true), 50); } const classes = useStyles();