(msg: TerminalInputMessage)
| 574 | } |
| 575 | |
| 576 | private onTerminalInput(msg: TerminalInputMessage): void { |
| 577 | if (this.terminalHandler === undefined) { |
| 578 | this.send(buildAck(msg.id, ErrorCode.INTERNAL_ERROR, 'terminal handler not wired', {})); |
| 579 | return; |
| 580 | } |
| 581 | const { session_id, terminal_id, data } = msg.payload; |
| 582 | this.terminalHandler |
| 583 | .write(session_id, terminal_id, data) |
| 584 | .then(() => { |
| 585 | this.send(buildAck(msg.id, 0, 'success', { accepted: true })); |
| 586 | }) |
| 587 | .catch((err: unknown) => { |
| 588 | this.sendTerminalErrorAck(msg.id, err, 'terminal_input failed'); |
| 589 | }); |
| 590 | } |
| 591 | |
| 592 | private onTerminalResize(msg: TerminalResizeMessage): void { |
| 593 | if (this.terminalHandler === undefined) { |
no test coverage detected