(key, value)
| 396 | * @param {any} value |
| 397 | */ |
| 398 | export async function updateActiveTerminals(key, value) { |
| 399 | // Find all terminal tabs and update their settings |
| 400 | const terminalTabs = editorManager.files.filter( |
| 401 | (file) => file.type === "terminal", |
| 402 | ); |
| 403 | |
| 404 | terminalTabs.forEach(async (tab) => { |
| 405 | if (tab.terminalComponent) { |
| 406 | const terminalOptions = {}; |
| 407 | |
| 408 | switch (key) { |
| 409 | case "fontSize": |
| 410 | tab.terminalComponent.terminal.options.fontSize = value; |
| 411 | break; |
| 412 | case "fontFamily": |
| 413 | // Load font if it's not already loaded |
| 414 | try { |
| 415 | fonts.injectFontFace(value); |
| 416 | await fonts.loadFont(value); |
| 417 | } catch (error) { |
| 418 | console.warn(`Failed to load font ${value}:`, error); |
| 419 | } |
| 420 | tab.terminalComponent.terminal.options.fontFamily = value; |
| 421 | tab.terminalComponent.terminal.refresh( |
| 422 | 0, |
| 423 | tab.terminalComponent.terminal.rows - 1, |
| 424 | ); |
| 425 | break; |
| 426 | case "fontWeight": |
| 427 | tab.terminalComponent.terminal.options.fontWeight = value; |
| 428 | break; |
| 429 | case "cursorBlink": |
| 430 | tab.terminalComponent.terminal.options.cursorBlink = value; |
| 431 | break; |
| 432 | case "cursorStyle": |
| 433 | tab.terminalComponent.terminal.options.cursorStyle = value; |
| 434 | break; |
| 435 | case "cursorInactiveStyle": |
| 436 | tab.terminalComponent.terminal.options.cursorInactiveStyle = value; |
| 437 | break; |
| 438 | case "scrollback": |
| 439 | tab.terminalComponent.terminal.options.scrollback = value; |
| 440 | break; |
| 441 | case "tabStopWidth": |
| 442 | tab.terminalComponent.terminal.options.tabStopWidth = value; |
| 443 | break; |
| 444 | case "convertEol": |
| 445 | tab.terminalComponent.terminal.options.convertEol = value; |
| 446 | break; |
| 447 | case "letterSpacing": |
| 448 | tab.terminalComponent.terminal.options.letterSpacing = value; |
| 449 | break; |
| 450 | case "theme": |
| 451 | tab.terminalComponent.terminal.options.theme = |
| 452 | TerminalThemeManager.getTheme(value); |
| 453 | // Update container background to match new theme |
| 454 | if (tab.terminalComponent.container) { |
| 455 | tab.terminalComponent.container.style.background = |
no test coverage detected