一、打开HBuilder X根目录
依次找到main.js
HBuilderX plugins builtincef3terminal script main.js
二、编辑main.js
将17到40行代码的powershell.exe跟cmd.exe都改为绝对路径。
下面为示例:
if(isWin){ntshell = 'C:/Windows/System32/WindowsPowerShell/v1.0/powershell.exe';ntvar osRelease = os.release();ntvar dotIndex = osRelease.indexOf('.');ntif(dotIndex>0){nttvar fv = osRelease.substring(0,dotIndex);nttif(fv>6){ntttshell = 'C:/Windows/System32/WindowsPowerShell/v1.0/powershell.exe';ntt}else{ntttshell = 'C:/Windows/WinSxS/wow64_microsoft-windows-commandprompt_31bf3856ad364e35_10.0.16299.15_none_b84d9d01bfe1be94/cmd.exe';ntttvar ov = osRelease.substring(dotIndex);ntttdotIndex = ov.indexOf('.');ntttif(dotIndex>0){nttttvar sv = ov.substring(0,dotIndex);nttttif(sv>1){ntttttshell = 'C:/Windows/System32/WindowsPowerShell/v1.0/powershell.exe';ntttt}nttt}ntt}nt}n}else{ntshell = 'bash';n}n// 下面这行日志不能删除,用于判断是否为powershellnconsole.log("powershell:"+(shell=='C:/Windows/System32/WindowsPowerShell/v1.0/powershell.exe'));
保存,重启终端窗口。
。。。。。。。。。。。。。
作者:Vam的金豆之路
篇幅有限更多请见扩展链接:http://www.mark-to-win.com/tutorial/50857.html