(timeoutMs = 5000)
| 548 | }); |
| 549 | if (terminal?.component) { |
| 550 | const waitForConnection = (timeoutMs = 5000) => |
| 551 | new Promise((resolve, reject) => { |
| 552 | const startTime = Date.now(); |
| 553 | const check = () => { |
| 554 | if (terminal.component.isConnected) { |
| 555 | resolve(); |
| 556 | } else if (Date.now() - startTime > timeoutMs) { |
| 557 | reject(new Error("Terminal connection timeout")); |
| 558 | } else { |
| 559 | setTimeout(check, 50); |
| 560 | } |
| 561 | }; |
| 562 | check(); |
| 563 | }); |
| 564 | await waitForConnection(); |
| 565 | terminal.component.write(`cd ${JSON.stringify(prootPath)}\n`); |
| 566 | Sidebar.hide(); |
no test coverage detected