You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

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

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.02 19:51:00