Skip to content

Commit bef731c

Browse files
format
1 parent 0c52c73 commit bef731c

File tree

1 file changed

+24
-15
lines changed

1 file changed

+24
-15
lines changed

src/components/terminal/terminal.js

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -567,13 +567,16 @@ export default class TerminalComponent {
567567
rows: this.terminal.rows,
568568
};
569569

570-
const response = await fetch(`http://localhost:${this.options.port}/terminals`, {
571-
method: "POST",
572-
headers: {
573-
"Content-Type": "application/json",
570+
const response = await fetch(
571+
`http://localhost:${this.options.port}/terminals`,
572+
{
573+
method: "POST",
574+
headers: {
575+
"Content-Type": "application/json",
576+
},
577+
body: JSON.stringify(requestBody),
574578
},
575-
body: JSON.stringify(requestBody),
576-
});
579+
);
577580

578581
if (!response.ok) {
579582
throw new Error(`HTTP error! status: ${response.status}`);
@@ -659,13 +662,16 @@ export default class TerminalComponent {
659662
if (!this.pid || !this.serverMode) return;
660663

661664
try {
662-
await fetch(`http://localhost:${this.options.port}/terminals/${this.pid}/resize`, {
663-
method: "POST",
664-
headers: {
665-
"Content-Type": "application/json",
665+
await fetch(
666+
`http://localhost:${this.options.port}/terminals/${this.pid}/resize`,
667+
{
668+
method: "POST",
669+
headers: {
670+
"Content-Type": "application/json",
671+
},
672+
body: JSON.stringify({ cols, rows }),
666673
},
667-
body: JSON.stringify({ cols, rows }),
668-
});
674+
);
669675
} catch (error) {
670676
console.error("Failed to resize terminal:", error);
671677
}
@@ -954,9 +960,12 @@ export default class TerminalComponent {
954960

955961
if (this.pid && this.serverMode) {
956962
try {
957-
await fetch(`http://localhost:${this.options.port}/terminals/${this.pid}/terminate`, {
958-
method: "POST",
959-
});
963+
await fetch(
964+
`http://localhost:${this.options.port}/terminals/${this.pid}/terminate`,
965+
{
966+
method: "POST",
967+
},
968+
);
960969
} catch (error) {
961970
console.error("Failed to terminate terminal:", error);
962971
}

0 commit comments

Comments
 (0)