(cols: number, rows: number)
| 265 | } |
| 266 | |
| 267 | const scheduleSize = (cols: number, rows: number) => { |
| 268 | if (disposed) return |
| 269 | if (lastSize?.cols === cols && lastSize?.rows === rows) return |
| 270 | |
| 271 | pendingSize = { cols, rows } |
| 272 | |
| 273 | if (!lastSize) { |
| 274 | lastSize = pendingSize |
| 275 | void pushSize(cols, rows) |
| 276 | return |
| 277 | } |
| 278 | |
| 279 | if (sizeTimer !== undefined) return |
| 280 | sizeTimer = setTimeout(() => { |
| 281 | sizeTimer = undefined |
| 282 | const next = pendingSize |
| 283 | if (!next) return |
| 284 | pendingSize = undefined |
| 285 | if (disposed) return |
| 286 | if (lastSize?.cols === next.cols && lastSize?.rows === next.rows) return |
| 287 | lastSize = next |
| 288 | void pushSize(next.cols, next.rows) |
| 289 | }, 100) |
| 290 | } |
| 291 | |
| 292 | createEffect(() => { |
| 293 | const colors = terminalColors() |
no test coverage detected