opensumi / ide-electron

OpenSumi Electron Version
https://opensumi.com
MIT License
176 stars 60 forks source link

终端窗口空白 #9

Closed crimx closed 2 years ago

crimx commented 2 years ago

现象:

终端窗口空白。console 报错:

Uncaught (in promise) TypeError: this._terminal.onWriteParsed is not a function
    at e.activate (xterm-addon-search.js:1:832)
    at e.loadAddon (xterm.js:1:76801)
    at e.loadAddon (xterm.js:1:308730)
    at XTerm._prepareAddons (xterm.js:24:1)
    at new XTerm (xterm.js:18:1)
    at Injector.__webpack_modules__../node_modules/@opensumi/di/dist/injector.js.Injector.createInstanceWithInjector (injector.js:517:1)
    at Injector.__webpack_modules__../node_modules/@opensumi/di/dist/injector.js.Injector.createInstanceFromClassCreator (injector.js:485:1)
    at Injector.__webpack_modules__../node_modules/@opensumi/di/dist/injector.js.Injector.createInstance (injector.js:467:1)
    at Injector.__webpack_modules__../node_modules/@opensumi/di/dist/injector.js.Injector.get (injector.js:192:1)
    at new TerminalClient (terminal.client.js:44:1)
    at Injector.__webpack_modules__../node_modules/@opensumi/di/dist/injector.js.Injector.createInstanceWithInjector (injector.js:517:1)
    at Injector.__webpack_modules__../node_modules/@opensumi/di/dist/injector.js.Injector.createInstanceFromClassCreator (injector.js:485:1)
    at Injector.__webpack_modules__../node_modules/@opensumi/di/dist/injector.js.Injector.createInstance (injector.js:467:1)
    at Injector.__webpack_modules__../node_modules/@opensumi/di/dist/injector.js.Injector.get (injector.js:192:1)
    at Function.createClient2 (terminal.client.js:635:1)
    at TerminalController.<anonymous> (terminal.client.js:646:1)
    at TerminalController._createClient (terminal.controller.js:63:1)
    at TerminalController._createClientOrIgnore (terminal.controller.js:58:1)
    at terminal.controller.js:166:1
    at Emitter.fire (event.js:440:1)
    at TerminalGroupViewService.createWidget (terminal.view.js:299:1)
    at TerminalController._reset (terminal.controller.js:106:1)
    at TerminalController.firstInitialize (terminal.controller.js:218:1)
    at terminal.lifecycle.js:23:1
    at runNextTicks (node:internal/process/task_queues:61:5)
    at processImmediate (node:internal/timers:437:9)

复现步骤:

git clone git@github.com:opensumi/ide-electron.git
cd ide-electron
yarn
yarn run build
yarn run rebuild-native -- --force-rebuild=true
yarn run download-extension
yarn run start
yantze commented 2 years ago

@bytemain 看看,我本地没有复现

bytemain commented 2 years ago

可以复现,我来看一下

bytemain commented 2 years ago

https://github.com/xtermjs/xterm.js/commit/a5f2ea336eff69c784414f371baacde641f03517

xterm-addon-search 18 小时前发布了 0.9.0-beta.37,变更内容见上面这个 commit,需要锁一下版本:

建议我们锁一下版本: https://github.com/xtermjs/xterm.js/releases/tag/4.18.0

xterm@4.18.0 xterm-addon-fit@0.5.0 xterm-addon-search@0.8.2

yantze commented 2 years ago

那还是要开放 yarn.lock 文件和 resolutions

bytemain commented 2 years ago

先使用 resolutions 加上了,随后我们在 core 上也修复一下这个问题。重新拉一下 main,装一下依赖,重新 build 一下就可以跑了