fix not being able to ctrlc the terminal

This commit is contained in:
Olivier Gagnon 2021-09-16 21:03:14 -04:00
parent 4bf3e5a2e4
commit 195dff7c44
2 changed files with 3 additions and 3 deletions

@ -140,9 +140,9 @@ export function TerminalInput({ terminal, engine, player }: IProps): React.React
useEffect(() => { useEffect(() => {
function keyDown(this: Document, event: KeyboardEvent): void { function keyDown(this: Document, event: KeyboardEvent): void {
if (terminal.contractOpen) return; if (terminal.contractOpen) return;
if (event.metaKey || event.ctrlKey) return;
const ref = terminalInput.current; const ref = terminalInput.current;
if (ref) ref.focus(); if (ref) ref.focus();
// Cancel action // Cancel action
if (event.keyCode === KEY.C && event.ctrlKey) { if (event.keyCode === KEY.C && event.ctrlKey) {
terminal.finishAction(player, true); terminal.finishAction(player, true);
@ -351,7 +351,7 @@ export function TerminalInput({ terminal, engine, player }: IProps): React.React
className: classes.input, className: classes.input,
startAdornment: ( startAdornment: (
<> <>
<Typography color={terminal.action === null ? "primary" : "secondary"}> <Typography color={terminal.action === null ? "primary" : "secondary"} flexShrink={0}>
[{player.getCurrentServer().hostname}&nbsp;~{terminal.cwd()}]&gt;&nbsp; [{player.getCurrentServer().hostname}&nbsp;~{terminal.cwd()}]&gt;&nbsp;
</Typography> </Typography>
</> </>

@ -62,7 +62,7 @@ export function TerminalRoot({ terminal, engine, player }: IProps): React.ReactE
const hook = scrollHook.current; const hook = scrollHook.current;
if (hook !== null) { if (hook !== null) {
setTimeout(() => hook.scrollIntoView(true), 10); setTimeout(() => hook.scrollIntoView(true), 50);
} }
const classes = useStyles(); const classes = useStyles();