Alacritty启动时运行Shell脚本失效问题求助(macOS环境)
解决Alacritty启动脚本不生效的问题
你的配置问题出在args参数的写法上——把-c和脚本路径合并成了一个参数,zsh的-c选项需要单独作为一个参数项,后续的脚本路径或命令要单独拆分出来。
正确的配置写法有两种:
方式一:通过zsh执行脚本
shell: program: /bin/zsh args: - -c - "/full/path/to/myScript/hello.sh"
方式二:直接执行脚本(需脚本有可执行权限)
先给脚本添加可执行权限:
chmod +x /full/path/to/myScript/hello.sh
再修改配置:
shell: program: "/full/path/to/myScript/hello.sh" args: []
如果你的脚本只是简单输出Hello!,也可以直接把命令写在配置里,省去单独的脚本文件:
shell: program: /bin/zsh args: - -c - "echo Hello!"
内容的提问来源于stack exchange,提问作者ranemirusG
相关产品推荐
相关产品推荐

