Exec --no-startup-id <command> 表示“--”无效选项

Exec --no-startup-id <command> says "--" invalid option

我试图在没有 "wait cursor" 的情况下启动应用程序,根据 i3 userguide 我应该使用 exec 的 --no-statrup-id 选项,但它给了我 "impossible" 错误。

$ exec --no-startup-id firefox
bash: exec: --: invalid option
exec: usage: exec [-cl] [-a name] [command [arguments ...]] [redirection ...]

谁能给我解释一下这是怎么回事?在每本手册中,我发现人们使用这个标志,但是 man exec 没有关于这个功能的信息。

i3 用户指南 中编写的语法适用于您的 i3 配置文件,如果您想 运行 shell 使用 i3-msg 命令

i3-msg exec --no-startup-id firefox

Bash manual 中查找有关 exec 的内置函数:

Unless otherwise noted, each builtin command documented as accepting options preceded by ‘-’ accepts ‘--’ to signify the end of the options.

编辑:
我可以启动 firefox,我的输出 return 0 和 true

i3-msg: unrecognized option '--no-startup-id'
[{"success":true}]

我看了一下 i3 source,我发现了一些有趣的东西
parser-specs/config.spec :

# <exec|exec_always> [--no-startup-id] command
state EXEC:
  no_startup_id = '--no-startup-id'
    ->
  command = string
    -> call cfg_exec($exectype, $no_startup_id, $command)

parser-specs/commands.spec :

# exec [--no-startup-id] <command>
state EXEC:
  nosn = '--no-startup-id'
    ->
  command = string
    -> call cmd_exec($nosn, $command)

但我的语法技能不够,无法更进一步。

只需使用引号即可避免 i3-msg 解析参数。

 user  ~ | MyDE  i3-msg exec --no-startup-id /home/mbp/MyDE/xrandr/dock.sh
i3-msg: unrecognized option '--no-startup-id'
 user  ~ | MyDE  i3-msg "exec --no-startup-id /home/mbp/MyDE/xrandr/dock.sh"
[{"success":true}]