linevich linevich - 10 months ago 94
Linux Question

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

I'm trying to launch applications without "wait cursor", according to i3 userguide I should use

option of exec but it gives me "impossible" error.

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

Can anybody explain to me what's wrong? In every manual, I find that people use this flag, but
man exec
have no information about this feature.

Answer Source

The syntax written in i3 userguide is for your i3 config file, if you want to run it in your shell use the i3-msg command

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

Find in Bash manual about builtin like exec:

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

I can launch firefox, my output return 0 and a true

i3-msg: unrecognized option '--no-startup-id'

I take a look on i3 source and I find something interesting
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)

But I'ven't enough skills in grammar to go further.