mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-09 17:23:53 +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