rdesktop^2
bunsenstraat 2 years ago
parent 15d1a0189c
commit a2d511d445
  1. 4
      apps/1test/src/remix/ui/remix-ui-xterm.tsx
  2. 7
      apps/1test/src/remix/ui/remix-ui-xterminals.tsx

@ -16,10 +16,6 @@ const RemixUiXterm = (props: RemixUiXtermProps) => {
const { plugin, pid, send, data, timeStamp } = props
const xtermRef = React.useRef(null)
useEffect(() => {
console.log('remix-ui-xterm', pid)
}, [timeStamp])
useEffect(() => {
console.log('remix-ui-xterm ref', xtermRef.current)
props.setTerminalRef(pid, xtermRef.current)

@ -19,17 +19,12 @@ export const RemixUiXterminals = (props: RemixUiXterminalsProps) => {
useEffect(() => {
plugin.on('xterm', 'loaded', async () => {
console.log('xterms loaded')
})
plugin.on('xterm', 'data', async (data: string, pid: number) => {
console.log('xterm data', data, pid)
writeToTerminal(data, pid)
})
plugin.on('xterm', 'close', async (pid: number) => {
console.log('xterm close', pid)
setTerminals(prevState => {
return prevState.filter(xtermState => xtermState.pid !== pid)
})
@ -52,13 +47,11 @@ export const RemixUiXterminals = (props: RemixUiXterminalsProps) => {
}, [terminals])
const send = (data: string, pid: number) => {
console.log('send', data)
plugin.call('xterm', 'keystroke', data, pid)
}
const createTerminal = async () => {
const pid = await plugin.call('xterm', 'createTerminal')
console.log('pid', pid)
setTerminals(prevState => {
return [...prevState, {

Loading…
Cancel
Save