mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-30 11:33:47 +01:00
fix not being able to ctrlc the terminal
This commit is contained in:
parent
4bf3e5a2e4
commit
195dff7c44
@ -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} ~{terminal.cwd()}]>
|
[{player.getCurrentServer().hostname} ~{terminal.cwd()}]>
|
||||||
</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();
|
||||||
|
Loading…
Reference in New Issue
Block a user