Skip to content

Commit

Permalink
fix terminal size
Browse files Browse the repository at this point in the history
  • Loading branch information
chenyan-dfinity committed Sep 14, 2024
1 parent 7b90932 commit d5697c0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ const worker = Comlink.wrap(
new Worker(new URL("./workers/moc.ts", import.meta.url), { type: "module" }),
);
const terminal = new Terminal({
convertEol: true,
cursorBlink: true,
fontSize: 14,
fontFamily: "monospace",
Expand Down
9 changes: 8 additions & 1 deletion src/webcontainer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,14 @@ export class Container {
args: string[],
options?: SpawnOptions,
) {
const process = await this.container!.spawn(cmd, args, options);
const new_options = {
...options,
terminal: {
cols: this.terminal.cols,
rows: this.terminal.rows,
},
};
const process = await this.container!.spawn(cmd, args, new_options);
process.output.pipeTo(
new WritableStream({
write: (data) => {
Expand Down

0 comments on commit d5697c0

Please sign in to comment.