| 298 | } |
| 299 | |
| 300 | private createSession(input: StartCommandInput): ProcessSession { |
| 301 | let resolveExit = (): void => undefined; |
| 302 | const exitPromise = new Promise<void>((resolve) => { |
| 303 | resolveExit = resolve; |
| 304 | }); |
| 305 | |
| 306 | return { |
| 307 | id: this.nextSessionId++, |
| 308 | workspaceId: input.workspaceId, |
| 309 | startedAt: Date.now(), |
| 310 | columns: terminalSize(input.columns, DEFAULT_COLUMNS), |
| 311 | rows: terminalSize(input.rows, DEFAULT_ROWS), |
| 312 | buffer: new HeadTailBuffer(this.maxBufferCharacters), |
| 313 | running: true, |
| 314 | exitPromise, |
| 315 | resolveExit, |
| 316 | }; |
| 317 | } |
| 318 | |
| 319 | private startPipe(session: ProcessSession, input: StartCommandInput): void { |
| 320 | const shell = resolveShellCommand(input.command); |