mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-12-24 07:02:26 +01:00
TERMINAL: Allow new lines in terminal when empty (#605)
This commit is contained in:
parent
c7d05cae58
commit
2537ded3c2
@ -194,12 +194,14 @@ export function TerminalInput(): React.ReactElement {
|
||||
async function onKeyDown(event: React.KeyboardEvent<HTMLInputElement>): Promise<void> {
|
||||
const ref = terminalInput.current;
|
||||
|
||||
// Run command.
|
||||
if (event.key === KEY.ENTER && value !== "") {
|
||||
// Run command or insert newline
|
||||
if (event.key === KEY.ENTER) {
|
||||
event.preventDefault();
|
||||
Terminal.print(`[${Player.getCurrentServer().hostname} /${Terminal.cwd()}]> ${value}`);
|
||||
if (value) {
|
||||
Terminal.executeCommands(value);
|
||||
saveValue("");
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user