From 3d926e82310cc028ba44c3d26637c29007528bd4 Mon Sep 17 00:00:00 2001 From: Florian PAUL Date: Wed, 27 Nov 2024 15:20:16 +0100 Subject: [PATCH] fix(training): terminal no longer working --- .../webcontainer/webcontainer-runner.ts | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/apps/showcase/src/services/webcontainer/webcontainer-runner.ts b/apps/showcase/src/services/webcontainer/webcontainer-runner.ts index 87206db8c0..0a3b29bfd1 100644 --- a/apps/showcase/src/services/webcontainer/webcontainer-runner.ts +++ b/apps/showcase/src/services/webcontainer/webcontainer-runner.ts @@ -5,20 +5,21 @@ import { Terminal } from '@xterm/xterm'; import { BehaviorSubject, combineLatest, + from, + fromEvent, + Observable, + of +} from 'rxjs'; +import { combineLatestWith, distinctUntilChanged, filter, - from, - fromEvent, map, - Observable, - of, skip, switchMap, take, timeout -} from 'rxjs'; -import { withLatestFrom } from 'rxjs/operators'; +} from 'rxjs/operators'; import { createTerminalStream, killTerminal, makeProcessWritable } from './webcontainer.helpers'; @Injectable({ @@ -119,7 +120,7 @@ export class WebContainerRunner { combineLatestWith( this.shell.cwd.pipe(filter((cwd): cwd is string => !!cwd)) ), - withLatestFrom(this.instancePromise), + combineLatestWith(this.instancePromise), takeUntilDestroyed() ).subscribe(async ([[writer, processCwd], instance]) => { try { @@ -134,7 +135,7 @@ export class WebContainerRunner { combineLatestWith( this.shell.terminal.pipe(filter((terminal): terminal is Terminal => !!terminal)) ), - withLatestFrom(this.instancePromise), + combineLatestWith(this.instancePromise), switchMap(([[_, terminal], instance]) => { // eslint-disable-next-line @typescript-eslint/naming-convention const spawn = instance.spawn('jsh', [], {env: {O3R_METRICS: false}});