Skip to content
This repository was archived by the owner on Nov 13, 2024. It is now read-only.

Commit 5a7fb35

Browse files
committed
Fix: multi-command stop command
use textarea for input
1 parent b0f0470 commit 5a7fb35

File tree

2 files changed

+2
-14
lines changed

2 files changed

+2
-14
lines changed

src/entity/commands/general/general_stop.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,8 @@ export default class GeneralStopCommand extends InstanceCommand {
1616

1717
instance.status(Instance.STATUS_STOPPING);
1818

19-
const stopCommandList = stopCommand.split(/(\^c|\^C|\\n|\\N)/g);
19+
const stopCommandList = stopCommand.split("\n");
2020
for (const stopCommandColumn of stopCommandList) {
21-
if (stopCommandColumn == "") {
22-
continue;
23-
}
24-
if (stopCommandColumn.toLocaleLowerCase() == "\\n") {
25-
continue;
26-
}
2721
if (stopCommandColumn.toLocaleLowerCase() == "^c") {
2822
instance.process.kill("SIGINT");
2923
} else {

src/entity/commands/pty/pty_stop.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,8 @@ export default class PtyStopCommand extends InstanceCommand {
1818

1919
instance.println("INFO", $t("pty_stop.execCmd", { stopCommand: stopCommand }));
2020

21-
const stopCommandList = stopCommand.split(/(\^c|\^C|\\n|\\N)/g);
21+
const stopCommandList = stopCommand.split("\n");
2222
for (const stopCommandColumn of stopCommandList) {
23-
if (stopCommandColumn == "") {
24-
continue;
25-
}
26-
if (stopCommandColumn.toLocaleLowerCase() == "\\n") {
27-
continue;
28-
}
2923
if (stopCommandColumn.toLocaleLowerCase() == "^c") {
3024
await instance.exec(new SendCommand("\x03"));
3125
} else {

0 commit comments

Comments
 (0)