desktopmerge
bunsenstraat 1 year ago
parent fd26c4f63a
commit ca44757c03
  1. 8
      libs/remix-ui/xterm/src/lib/components/remix-ui-xterminals.tsx

@ -30,9 +30,6 @@ export const RemixUiXterminals = (props: RemixUiXterminalsProps) => {
useEffect(() => { useEffect(() => {
setTimeout(async () => { setTimeout(async () => {
plugin.on('xterm', 'loaded', async () => {
console.log('xterm loaded')
})
plugin.on('xterm', 'data', async (data: string, pid: number) => { plugin.on('xterm', 'data', async (data: string, pid: number) => {
writeToTerminal(data, pid) writeToTerminal(data, pid)
@ -79,9 +76,6 @@ export const RemixUiXterminals = (props: RemixUiXterminalsProps) => {
const theme = await plugin.call('theme', 'currentTheme') const theme = await plugin.call('theme', 'currentTheme')
handleThemeChange(theme) handleThemeChange(theme)
const shells = await plugin.call('xterm', 'getShells')
setShells(shells)
}, 2000) }, 2000)
}, []) }, [])
@ -119,6 +113,8 @@ export const RemixUiXterminals = (props: RemixUiXterminalsProps) => {
const createTerminal = async (shell?: string) => { const createTerminal = async (shell?: string) => {
const shells = await plugin.call('xterm', 'getShells')
setShells(shells)
const pid = await plugin.call('xterm', 'createTerminal', workingDir, shell) const pid = await plugin.call('xterm', 'createTerminal', workingDir, shell)
setShowOutput(false) setShowOutput(false)
setTerminals(prevState => { setTerminals(prevState => {

Loading…
Cancel
Save