Open kyrosle opened 1 year ago
Same here, I tried Nu and MSYS 2 Fish Shell on Windows both got the same error
Error messages:
* 正在执行任务: xmake -w
error: Unable to read input file: Is a directory
warning: Error while reading file /d
* 终端进程“C:\msys64\usr\bin\fish.exe /d /c xmake -w”已终止,退出代码: 127。
* 终端将被任务重用,按任意键关闭。
BTW it will work properly in Powershell in my environment
This bug seems to belong to vscode. I am also waiting for a fix. https://github.com/microsoft/vscode/issues/169821
该问题与vscode的API--ShellExecution有关
当我们使用xmake的相关命令时,扩展会生成对应的command,然后尝试在shell中执行。参考terminal.ts
问题在于ShellExecution会尝试将command作为参数,传递给非交互模式的shell执行。对于 bash ,会在vscode集成终端中生成任务 bash -c "xmake command",对于cmd ,则是 cmd /d /c "xmake command" 在 bash / powershell / cmd 中,这可以正常工作。而这里使用的Nushell 比较小众,vscode没有相关配置,fallback到了cmd 的模板,即尝试执行 nu /d /c "xmake command",因而产生错误
要解决这一问题,可以使用ProcessExecution或者CustomExecution以代替ShellExecution。cmake-tools的实现方法 也许能提供一些参考
Xmake Version
v2.7.8+HEAD.87dff1ef4
Operating System Version and Architecture
win11
Describe Bug
using the xmake command to creat project or run the project, this error will show:
my vscode revlant setting:
i using nushell in vscode. the the running command would have something
\d \c
which casuse the error.Expected Behavior
Project Configuration
No response
Additional Information and Error Logs
No response