使用HBuilder X编辑器安装终端窗口插件未响应的解决方案

2022-06-22 20:20:06 浏览数 (1)

一、打开HBuilder X根目录

依次找到main.js

代码语言:text复制
HBuilderX  plugins  builtincef3terminal  script  main.js

二、编辑main.js

将17到40行代码的powershell.exe跟cmd.exe都改为绝对路径。

下面为示例:

if(isWin){ shell = ‘C:/Windows/System32/WindowsPowerShell/v1.0/powershell.exe’; var osRelease = os.release(); var dotIndex = osRelease.indexOf(’.’); if(dotIndex>0){ var fv = osRelease.substring(0,dotIndex); if(fv>6){ shell = ‘C:/Windows/System32/WindowsPowerShell/v1.0/powershell.exe’; }else{ shell = ‘‪C:/Windows/WinSxS/wow64_microsoft-windows-commandprompt_31bf3856ad364e35_10.0.16299.15_none_b84d9d01bfe1be94/cmd.exe’; var ov = osRelease.substring(dotIndex); dotIndex = ov.indexOf(’.’); if(dotIndex>0){ var sv = ov.substring(0,dotIndex); if(sv>1){ shell = ‘C:/Windows/System32/WindowsPowerShell/v1.0/powershell.exe’;

更多内容请见原文,原文转载自:https://blog.csdn.net/weixin_44519496/article/details/119924214

0 人点赞