| 911 | }, |
| 912 | |
| 913 | async getCaps(): Promise<TerminalCaps> { |
| 914 | if (disposed) throw new Error("NodeBackend: disposed"); |
| 915 | if (fatal !== null) throw fatal; |
| 916 | |
| 917 | // Return cached caps if available |
| 918 | if (cachedCaps !== null) { |
| 919 | return cachedCaps; |
| 920 | } |
| 921 | |
| 922 | // If not started, return default caps |
| 923 | if (!started || worker === null) { |
| 924 | return DEFAULT_TERMINAL_CAPS; |
| 925 | } |
| 926 | |
| 927 | // Request caps from worker |
| 928 | const d = deferred<TerminalCaps>(); |
| 929 | capsWaiters.push(d); |
| 930 | send({ type: "getCaps" }); |
| 931 | return d.promise; |
| 932 | }, |
| 933 | |
| 934 | async getTerminalProfile(): Promise<TerminalProfile> { |
| 935 | const caps = await backend.getCaps(); |