diff options
author | Christian Duerr <contact@christianduerr.com> | 2023-11-08 07:03:24 +0100 |
---|---|---|
committer | Christian Duerr <contact@christianduerr.com> | 2023-11-11 20:33:06 +0100 |
commit | 2f097dac5c78a01bdb020c982a09867b3213a69b (patch) | |
tree | f751637a5d4eff5a151273b3bbc7c083d2ed8fc5 /extra | |
parent | 683b5a2cb47579560ed272dc1a4818507dbd30c7 (diff) | |
download | alacritty-2f097dac5c78a01bdb020c982a09867b3213a69b.tar.gz alacritty-2f097dac5c78a01bdb020c982a09867b3213a69b.zip |
Add `--option` argument to `create-window`
This patch adds a new CLI parameter to the `create-window` subcommand,
matching the existing `--option` parameter when creating a new Alacritty
instance.
This parameter allows setting up the initial window configuration from
the CLI without having to call `alacritty msg config`, making sure that
all options are set appropriately right from the start.
Closes #6238.
Diffstat (limited to 'extra')
-rw-r--r-- | extra/completions/_alacritty | 8 | ||||
-rw-r--r-- | extra/completions/alacritty.bash | 28 | ||||
-rw-r--r-- | extra/completions/alacritty.fish | 3 | ||||
-rw-r--r-- | extra/man/alacritty-msg.1.scd | 20 | ||||
-rw-r--r-- | extra/man/alacritty.1.scd | 2 |
5 files changed, 43 insertions, 18 deletions
diff --git a/extra/completions/_alacritty b/extra/completions/_alacritty index 6f21f450..a1739c4e 100644 --- a/extra/completions/_alacritty +++ b/extra/completions/_alacritty @@ -18,14 +18,14 @@ _alacritty() { '--embed=[X11 window ID to embed Alacritty within (decimal or hexadecimal with "0x" prefix)]:EMBED: ' \ '--config-file=[Specify alternative configuration file \[default\: \$XDG_CONFIG_HOME/alacritty/alacritty.toml\]]:CONFIG_FILE:_files' \ '--socket=[Path for IPC socket creation]:SOCKET:_files' \ -'*-o+[Override configuration file options \[example\: cursor.style=Beam\]]:OPTION: ' \ -'*--option=[Override configuration file options \[example\: cursor.style=Beam\]]:OPTION: ' \ '--working-directory=[Start the shell in the specified working directory]:WORKING_DIRECTORY:_files' \ '*-e+[Command and args to execute (must be last argument)]:COMMAND: ' \ '*--command=[Command and args to execute (must be last argument)]:COMMAND: ' \ '-T+[Defines the window title \[default\: Alacritty\]]:TITLE: ' \ '--title=[Defines the window title \[default\: Alacritty\]]:TITLE: ' \ '--class=[Defines window class/app_id on X11/Wayland \[default\: Alacritty\]]:general> | <general>,<instance: ' \ +'*-o+[Override configuration file options \[example\: '\''cursor.style="Beam"'\''\]]:OPTION: ' \ +'*--option=[Override configuration file options \[example\: '\''cursor.style="Beam"'\''\]]:OPTION: ' \ '--print-events[Print all events to stdout]' \ '--ref-test[Generates ref test]' \ '(-v)*-q[Reduces the level of verbosity (the min level is -qq)]' \ @@ -68,6 +68,8 @@ _arguments "${_arguments_options[@]}" \ '-T+[Defines the window title \[default\: Alacritty\]]:TITLE: ' \ '--title=[Defines the window title \[default\: Alacritty\]]:TITLE: ' \ '--class=[Defines window class/app_id on X11/Wayland \[default\: Alacritty\]]:general> | <general>,<instance: ' \ +'*-o+[Override configuration file options \[example\: '\''cursor.style="Beam"'\''\]]:OPTION: ' \ +'*--option=[Override configuration file options \[example\: '\''cursor.style="Beam"'\''\]]:OPTION: ' \ '--hold[Remain open after child process exit]' \ '-h[Print help]' \ '--help[Print help]' \ @@ -81,7 +83,7 @@ _arguments "${_arguments_options[@]}" \ '()--reset[Clear all runtime configuration changes]' \ '-h[Print help (see more with '\''--help'\'')]' \ '--help[Print help (see more with '\''--help'\'')]' \ -'*::options -- Configuration file options \[example\: cursor.style=Beam\]:' \ +'*::options -- Configuration file options \[example\: '\''cursor.style="Beam"'\''\]:' \ && ret=0 ;; (help) diff --git a/extra/completions/alacritty.bash b/extra/completions/alacritty.bash index 41547422..c1546f50 100644 --- a/extra/completions/alacritty.bash +++ b/extra/completions/alacritty.bash @@ -61,7 +61,7 @@ _alacritty() { case "${cmd}" in alacritty) - opts="-q -v -o -e -T -h -V --print-events --ref-test --embed --config-file --socket --option --working-directory --hold --command --title --class --help --version msg migrate help" + opts="-q -v -e -T -o -h -V --print-events --ref-test --embed --config-file --socket --working-directory --hold --command --title --class --option --help --version msg migrate help" if [[ ${cur} == -* || ${COMP_CWORD} -eq 1 ]] ; then COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 @@ -79,14 +79,6 @@ _alacritty() { COMPREPLY=($(compgen -f "${cur}")) return 0 ;; - --option) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - -o) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; --working-directory) COMPREPLY=($(compgen -f "${cur}")) return 0 @@ -111,6 +103,14 @@ _alacritty() { COMPREPLY=($(compgen -f "${cur}")) return 0 ;; + --option) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + -o) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; *) COMPREPLY=() ;; @@ -269,7 +269,7 @@ _alacritty() { return 0 ;; alacritty__msg__create__window) - opts="-e -T -h --working-directory --hold --command --title --class --help" + opts="-e -T -o -h --working-directory --hold --command --title --class --option --help" if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 @@ -299,6 +299,14 @@ _alacritty() { COMPREPLY=($(compgen -f "${cur}")) return 0 ;; + --option) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + -o) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; *) COMPREPLY=() ;; diff --git a/extra/completions/alacritty.fish b/extra/completions/alacritty.fish index fe02ea82..243f144a 100644 --- a/extra/completions/alacritty.fish +++ b/extra/completions/alacritty.fish @@ -1,11 +1,11 @@ complete -c alacritty -n "__fish_use_subcommand" -l embed -d 'X11 window ID to embed Alacritty within (decimal or hexadecimal with "0x" prefix)' -r complete -c alacritty -n "__fish_use_subcommand" -l config-file -d 'Specify alternative configuration file [default: $XDG_CONFIG_HOME/alacritty/alacritty.toml]' -r -F complete -c alacritty -n "__fish_use_subcommand" -l socket -d 'Path for IPC socket creation' -r -F -complete -c alacritty -n "__fish_use_subcommand" -s o -l option -d 'Override configuration file options [example: cursor.style=Beam]' -r complete -c alacritty -n "__fish_use_subcommand" -l working-directory -d 'Start the shell in the specified working directory' -r -F complete -c alacritty -n "__fish_use_subcommand" -s e -l command -d 'Command and args to execute (must be last argument)' -r complete -c alacritty -n "__fish_use_subcommand" -s T -l title -d 'Defines the window title [default: Alacritty]' -r complete -c alacritty -n "__fish_use_subcommand" -l class -d 'Defines window class/app_id on X11/Wayland [default: Alacritty]' -r +complete -c alacritty -n "__fish_use_subcommand" -s o -l option -d 'Override configuration file options [example: \'cursor.style="Beam"\']' -r complete -c alacritty -n "__fish_use_subcommand" -l print-events -d 'Print all events to stdout' complete -c alacritty -n "__fish_use_subcommand" -l ref-test -d 'Generates ref test' complete -c alacritty -n "__fish_use_subcommand" -s q -d 'Reduces the level of verbosity (the min level is -qq)' @@ -25,6 +25,7 @@ complete -c alacritty -n "__fish_seen_subcommand_from msg; and __fish_seen_subco complete -c alacritty -n "__fish_seen_subcommand_from msg; and __fish_seen_subcommand_from create-window" -s e -l command -d 'Command and args to execute (must be last argument)' -r complete -c alacritty -n "__fish_seen_subcommand_from msg; and __fish_seen_subcommand_from create-window" -s T -l title -d 'Defines the window title [default: Alacritty]' -r complete -c alacritty -n "__fish_seen_subcommand_from msg; and __fish_seen_subcommand_from create-window" -l class -d 'Defines window class/app_id on X11/Wayland [default: Alacritty]' -r +complete -c alacritty -n "__fish_seen_subcommand_from msg; and __fish_seen_subcommand_from create-window" -s o -l option -d 'Override configuration file options [example: \'cursor.style="Beam"\']' -r complete -c alacritty -n "__fish_seen_subcommand_from msg; and __fish_seen_subcommand_from create-window" -l hold -d 'Remain open after child process exit' complete -c alacritty -n "__fish_seen_subcommand_from msg; and __fish_seen_subcommand_from create-window" -s h -l help -d 'Print help' complete -c alacritty -n "__fish_seen_subcommand_from msg; and __fish_seen_subcommand_from config" -s w -l window-id -d 'Window ID for the new config' -r diff --git a/extra/man/alacritty-msg.1.scd b/extra/man/alacritty-msg.1.scd index f7f271aa..100b763e 100644 --- a/extra/man/alacritty-msg.1.scd +++ b/extra/man/alacritty-msg.1.scd @@ -19,14 +19,24 @@ making it possible to control Alacritty without directly accessing it. *create-window* Create a new window in the same Alacritty process - *OPTIONS* + *FLAGS* *--hold* Remain open after child process exits + *OPTIONS* *--working-directory* <working-directory> Start the shell in the specified working directory - *command* <command>... + *-T, --title* <TITLE> + Defines the window title [default: Alacritty] + + *--class* <GENERAL> | <GENERAL>,<INSTANCE> + Defines window class/app_id on X11/Wayland [default: Alacritty] + + *-o, --option* <OPTION>... + Override configuration file options [example: 'cursor.style="Beam"'] + + *-e, --command* <COMMAND>... Command and args to execute (must be last argument) *config* @@ -34,7 +44,11 @@ making it possible to control Alacritty without directly accessing it. *ARGS* *<CONFIG_OPTIONS>...* - Configuration file options [example: cursor.style=Beam] + Configuration file options [example: 'cursor.style="Beam"'] + + *FLAGS* + *-r, --reset* + Clear all runtime configuration changes *OPTIONS* *-w, --window-id* <WINDOW_ID> diff --git a/extra/man/alacritty.1.scd b/extra/man/alacritty.1.scd index 333d2310..6436db75 100644 --- a/extra/man/alacritty.1.scd +++ b/extra/man/alacritty.1.scd @@ -61,7 +61,7 @@ set of features with high performance. X11 window ID to embed Alacritty within (decimal or hexadecimal with _0x_ prefix) *-o, --option* <option>... - Override configuration file options [example: cursor.style=Beam] + Override configuration file options [example: 'cursor.style="Beam"'] *--socket* <socket> Path for IPC socket creation |