MCPcopy Create free account
hub / github.com/Acode-Foundation/Acode / updateActiveTerminals

Function updateActiveTerminals

src/settings/terminalSettings.js:398–468  ·  view source on GitHub ↗
(key, value)

Source from the content-addressed store, hash-verified

396 * @param {any} value
397 */
398export 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 =

Callers 4

applyFunction · 0.90
fontManager.jsFile · 0.90
setTerminalThemeFunction · 0.90
callbackFunction · 0.85

Calls 4

refreshMethod · 0.80
getThemeMethod · 0.80
updateImageSupportMethod · 0.80
updateFontLigaturesMethod · 0.80

Tested by

no test coverage detected