feat: allow to open up to three terminals (#22)

This commit is contained in:
Dominic Elm
2024-07-31 13:18:41 +02:00
committed by GitHub
parent 49196273b0
commit e5ed23c33d
6 changed files with 64 additions and 20 deletions

View File

@@ -3,9 +3,10 @@ import { WebLinksAddon } from '@xterm/addon-web-links';
import { Terminal as XTerm } from '@xterm/xterm';
import { forwardRef, memo, useEffect, useImperativeHandle, useRef } from 'react';
import type { Theme } from '~/lib/stores/theme';
import { createScopedLogger } from '~/utils/logger';
import { getTerminalTheme } from './theme';
import '@xterm/xterm/css/xterm.css';
const logger = createScopedLogger('Terminal');
export interface TerminalRef {
reloadStyles: () => void;
@@ -52,6 +53,8 @@ export const Terminal = memo(
resizeObserver.observe(element);
logger.info('Attach terminal');
onTerminalReady?.(terminal);
return () => {