rdesktop2
bunsenstraat 1 year ago
parent f4e3dfc01d
commit 1607d4a586
  1. 3
      apps/remixdesktop/package.json
  2. 6
      apps/remixdesktop/src/plugins/xtermPlugin.ts
  3. 18
      apps/remixdesktop/yarn.lock
  4. 1
      libs/remix-ui/xterm/src/index.ts
  5. 39
      libs/remix-ui/xterm/src/lib/components/remix-ui-filedialog.tsx
  6. 10
      libs/remix-ui/xterm/src/lib/components/remix-ui-xterminals.tsx
  7. 1
      package.json
  8. 5
      yarn.lock

@ -26,8 +26,7 @@
"start:production": "tsc && cross-env NODE_ENV=production electron .", "start:production": "tsc && cross-env NODE_ENV=production electron .",
"pack": "tsc && electron-builder", "pack": "tsc && electron-builder",
"dist": "tsc && electron-builder", "dist": "tsc && electron-builder",
"postinstall": "electron-builder install-app-deps", "postinstall": "electron-builder install-app-deps"
"rebuild-node-pty": "electron-rebuild -f -o node-pty"
}, },
"devDependencies": { "devDependencies": {
"@electron/rebuild": "^3.2.13", "@electron/rebuild": "^3.2.13",

@ -12,7 +12,7 @@ export const detectDefaultShell = () => {
const {env} = process; const {env} = process;
if (process.platform === 'win32') { if (process.platform === 'win32') {
return env.COMSPEC || 'cmd.exe'; return env.SHELL || 'powershell.exe';
} }
try { try {
@ -32,6 +32,8 @@ export const detectDefaultShell = () => {
// Stores default shell when imported. // Stores default shell when imported.
const defaultShell = detectDefaultShell(); const defaultShell = detectDefaultShell();
console.log('defaultShell', defaultShell)
export default defaultShell; export default defaultShell;
@ -73,6 +75,8 @@ class XtermPluginClient extends ElectronBasePluginClient {
async createTerminal(path?: string): Promise<number> { async createTerminal(path?: string): Promise<number> {
const shell = defaultShell; const shell = defaultShell;
console.log('defaultShell', defaultShell)
const ptyProcess = pty.spawn(shell, [], { const ptyProcess = pty.spawn(shell, [], {
name: 'xterm-color', name: 'xterm-color',
cols: 80, cols: 80,

@ -634,9 +634,9 @@
integrity sha512-iiUgKzV9AuaEkZqkOLDIvlQiL6ltuZd9tGcW3gwpnX8JbuiuhFlEGmmFXEXkN50Cvq7Os88IY2v0dkDqXYWVgA== integrity sha512-iiUgKzV9AuaEkZqkOLDIvlQiL6ltuZd9tGcW3gwpnX8JbuiuhFlEGmmFXEXkN50Cvq7Os88IY2v0dkDqXYWVgA==
"@types/node@*": "@types/node@*":
version "20.3.1" version "20.3.2"
resolved "https://registry.yarnpkg.com/@types/node/-/node-20.3.1.tgz#e8a83f1aa8b649377bb1fb5d7bac5cb90e784dfe" resolved "https://registry.yarnpkg.com/@types/node/-/node-20.3.2.tgz#fa6a90f2600e052a03c18b8cb3fd83dd4e599898"
integrity sha512-EhcH/wvidPy1WeML3TtYFGR83UzjxeWRen9V402T8aUGYsCHOmfoisV3ZSg03gAFIbLq8TnWOJ0f4cALtnSEUg== integrity sha512-vOBLVQeCQfIcF/2Y7eKFTqrMnizK5lRNQ7ykML/5RuwVXVWxYkgwS7xbt4B6fKCUPgbSL5FSsjHQpaGQP/dQmw==
"@types/node@^12.12.6": "@types/node@^12.12.6":
version "12.20.55" version "12.20.55"
@ -702,9 +702,9 @@
"@types/node" "*" "@types/node" "*"
"@vscode/ripgrep@^1.15.4": "@vscode/ripgrep@^1.15.4":
version "1.15.4" version "1.15.5"
resolved "https://registry.yarnpkg.com/@vscode/ripgrep/-/ripgrep-1.15.4.tgz#ca8946b5580bbea1e706ed8d3b1eed5f0d551ab6" resolved "https://registry.yarnpkg.com/@vscode/ripgrep/-/ripgrep-1.15.5.tgz#26025884bbc3a8b40dfc29f5bda4b87b47bd7356"
integrity sha512-+EPIS2aoD95MFLrgGHd/D2fck42aMRV2cBrT7BiNvKBeSyCTybSaTJ+PGQf6zV/95AhaXHHYqYPVRk3DZoGU9w== integrity sha512-PVvKNEmtnlek3i4MJMaB910dz46CKQqcIY2gKR3PSlfz/ZPlSYuSuyQMS7iK20KL4hGUdSbWt964B5S5EIojqw==
dependencies: dependencies:
https-proxy-agent "^5.0.0" https-proxy-agent "^5.0.0"
proxy-from-env "^1.1.0" proxy-from-env "^1.1.0"
@ -3271,9 +3271,9 @@ minimatch@^8.0.2:
brace-expansion "^2.0.1" brace-expansion "^2.0.1"
minimatch@^9.0.1: minimatch@^9.0.1:
version "9.0.1" version "9.0.2"
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-9.0.1.tgz#8a555f541cf976c622daf078bb28f29fb927c253" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-9.0.2.tgz#397e387fff22f6795844d00badc903a3d5de7057"
integrity sha512-0jWhJpD/MdhPXwPuiRkCbfYfSKp2qnn2eOc279qI7f+osl/l+prKSrvhg157zSYvx/1nmgn2NqdT6k2Z7zSH9w== integrity sha512-PZOT9g5v2ojiTL7r1xF6plNHLtOeTpSlDI007As2NlA2aYBMfVom17yqa6QzhmDP8QOhn7LjHTg7DFCVSSa6yg==
dependencies: dependencies:
brace-expansion "^2.0.1" brace-expansion "^2.0.1"

@ -1,3 +1,2 @@
export * from './lib/components/remix-ui-xterm' export * from './lib/components/remix-ui-xterm'
export * from './lib/components/remix-ui-filedialog'
export * from './lib/components/remix-ui-xterminals' export * from './lib/components/remix-ui-xterminals'

@ -1,39 +0,0 @@
import { Plugin } from "@remixproject/engine"
import React, { useEffect, useState } from "react"
interface RemixUIFileDialogInterface {
plugin: Plugin
}
export const RemixUIFileDialog = (props: RemixUIFileDialogInterface) => {
const { plugin } = props
const [files, setFiles] = useState<string[]>([])
const [workingDir, setWorkingDir] = useState<string>('')
useEffect(() => {
plugin.on('fs', 'workingDirChanged', async (path: string) => {
console.log('workingDirChanged')
setWorkingDir(path)
await readdir()
})
}, [])
const readdir = async () => {
const files = await plugin.call('fs', 'readdir', '/')
console.log('files', files)
setFiles(files)
}
return (
<>
<h1>RemixUIFileDialog</h1>
<button onClick={() => plugin.call('fs', 'setWorkingDir')}>open</button>
<button onClick={async () => await readdir()}>read</button>
<hr></hr>
{workingDir}
<hr></hr>
{files.map(file => <div key={file}>{file}</div>)}
</>
)
}

@ -2,6 +2,13 @@ import React, { useState, useEffect } from 'react' // eslint-disable-line
import { ElectronPlugin } from '@remixproject/engine-electron' import { ElectronPlugin } from '@remixproject/engine-electron'
import RemixUiXterm from './remix-ui-xterm' import RemixUiXterm from './remix-ui-xterm'
import {
ImperativePanelGroupHandle,
Panel,
PanelGroup,
PanelResizeHandle,
} from "react-resizable-panels";
export interface RemixUiXterminalsProps { export interface RemixUiXterminalsProps {
plugin: ElectronPlugin plugin: ElectronPlugin
} }
@ -91,9 +98,10 @@ export const RemixUiXterminals = (props: RemixUiXterminalsProps) => {
createTerminal() createTerminal()
}}>create terminal</button> }}>create terminal</button>
{terminals.map((xtermState) => { {terminals.map((xtermState) => {
return ( return (
<div key={xtermState.pid} data-id={`remixUIXT${xtermState.pid}`}>{xtermState.pid} <div key={xtermState.pid} data-id={`remixUIXT${xtermState.pid}`}>
<RemixUiXterm setTerminalRef={setTerminalRef} timeStamp={xtermState.timeStamp} send={send} pid={xtermState.pid} plugin={plugin}></RemixUiXterm> <RemixUiXterm setTerminalRef={setTerminalRef} timeStamp={xtermState.timeStamp} send={send} pid={xtermState.pid} plugin={plugin}></RemixUiXterm>
</div> </div>
) )

@ -201,6 +201,7 @@
"react-json-view": "^1.21.3", "react-json-view": "^1.21.3",
"react-markdown": "^8.0.5", "react-markdown": "^8.0.5",
"react-multi-carousel": "^2.8.2", "react-multi-carousel": "^2.8.2",
"react-resizable-panels": "^0.0.53",
"react-router-dom": "^6.3.0", "react-router-dom": "^6.3.0",
"react-tabs": "^3.2.2", "react-tabs": "^3.2.2",
"react-zoom-pan-pinch": "^3.0.2", "react-zoom-pan-pinch": "^3.0.2",

@ -24017,6 +24017,11 @@ react-refresh@^0.14.0:
resolved "https://registry.yarnpkg.com/react-refresh/-/react-refresh-0.14.0.tgz#4e02825378a5f227079554d4284889354e5f553e" resolved "https://registry.yarnpkg.com/react-refresh/-/react-refresh-0.14.0.tgz#4e02825378a5f227079554d4284889354e5f553e"
integrity sha512-wViHqhAd8OHeLS/IRMJjTSDHF3U9eWi62F/MledQGPdJGDhodXJ9PBLNGr6WWL7qlH12Mt3TyTpbS+hGXMjCzQ== integrity sha512-wViHqhAd8OHeLS/IRMJjTSDHF3U9eWi62F/MledQGPdJGDhodXJ9PBLNGr6WWL7qlH12Mt3TyTpbS+hGXMjCzQ==
react-resizable-panels@^0.0.53:
version "0.0.53"
resolved "https://registry.yarnpkg.com/react-resizable-panels/-/react-resizable-panels-0.0.53.tgz#d169e45f33ccb38cdc077e0f99049385e89883ca"
integrity sha512-lGOJF0Hh5+Y+Usi7x8btmBTi+6CQV1/RKxnj6jVrzvJ9vLbftbSoJPzymOuX8ZCFimlEwP2AKsGtQVKG/KieHA==
react-router-dom@^6.3.0: react-router-dom@^6.3.0:
version "6.3.0" version "6.3.0"
resolved "https://registry.yarnpkg.com/react-router-dom/-/react-router-dom-6.3.0.tgz#a0216da813454e521905b5fa55e0e5176123f43d" resolved "https://registry.yarnpkg.com/react-router-dom/-/react-router-dom-6.3.0.tgz#a0216da813454e521905b5fa55e0e5176123f43d"

Loading…
Cancel
Save