From 91749f7f1fa1580200082cb8a44af9478113c263 Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Sat, 3 Feb 2024 10:41:45 -0700 Subject: [PATCH] docs and missing bit of #4535 #4523 --- assets/shell-completion/bash | 61 ++++++++++++++++++++++++++++++++++-- assets/shell-completion/fish | 39 +++++++++++++++-------- assets/shell-completion/zsh | 33 +++++++++++++++++++ docs/changelog.md | 2 ++ wezterm-gui/src/main.rs | 3 ++ wezterm/src/main.rs | 7 +++++ 6 files changed, 130 insertions(+), 15 deletions(-) diff --git a/assets/shell-completion/bash b/assets/shell-completion/bash index 5d2c20ed52b..55399c3f0c0 100644 --- a/assets/shell-completion/bash +++ b/assets/shell-completion/bash @@ -12,6 +12,9 @@ _wezterm() { ",$1") cmd="wezterm" ;; + wezterm,blocking-start) + cmd="wezterm__blocking__start" + ;; wezterm,cli) cmd="wezterm__cli" ;; @@ -171,6 +174,9 @@ _wezterm() { wezterm__cli__help,zoom-pane) cmd="wezterm__cli__help__zoom__pane" ;; + wezterm__help,blocking-start) + cmd="wezterm__help__blocking__start" + ;; wezterm__help,cli) cmd="wezterm__help__cli" ;; @@ -274,7 +280,7 @@ _wezterm() { case "${cmd}" in wezterm) - opts="-n -h -V --skip-config --config-file --config --help --version start ssh serial connect ls-fonts show-keys cli imgcat set-working-directory record replay shell-completion help" + opts="-n -h -V --skip-config --config-file --config --help --version start blocking-start ssh serial connect ls-fonts show-keys cli imgcat set-working-directory record replay shell-completion help" if [[ ${cur} == -* || ${COMP_CWORD} -eq 1 ]] ; then COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 @@ -298,6 +304,43 @@ _wezterm() { COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 ;; + wezterm__blocking__start) + opts="-e -h --no-auto-connect --always-new-process --new-tab --cwd --class --workspace --position --domain --attach --help [PROG]..." + if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + --cwd) + COMPREPLY=() + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o plusdirs + fi + return 0 + ;; + --class) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --workspace) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --position) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --domain) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; wezterm__cli) opts="-h --no-auto-start --prefer-mux --class --help list list-clients proxy tlscreds move-pane-to-new-tab split-pane spawn send-text get-text activate-pane-direction get-pane-direction kill-pane activate-pane adjust-pane-size activate-tab set-tab-title set-window-title rename-workspace zoom-pane help" if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then @@ -1053,7 +1096,7 @@ _wezterm() { return 0 ;; wezterm__help) - opts="start ssh serial connect ls-fonts show-keys cli imgcat set-working-directory record replay shell-completion help" + opts="start blocking-start ssh serial connect ls-fonts show-keys cli imgcat set-working-directory record replay shell-completion help" if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 @@ -1066,6 +1109,20 @@ _wezterm() { COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 ;; + wezterm__help__blocking__start) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; wezterm__help__cli) opts="list list-clients proxy tlscreds move-pane-to-new-tab split-pane spawn send-text get-text activate-pane-direction get-pane-direction kill-pane activate-pane adjust-pane-size activate-tab set-tab-title set-window-title rename-workspace zoom-pane" if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then diff --git a/assets/shell-completion/fish b/assets/shell-completion/fish index 440af2b38fa..bf1f6dfeb7b 100644 --- a/assets/shell-completion/fish +++ b/assets/shell-completion/fish @@ -4,6 +4,7 @@ complete -c wezterm -n "__fish_use_subcommand" -s n -l skip-config -d 'Skip load complete -c wezterm -n "__fish_use_subcommand" -s h -l help -d 'Print help' complete -c wezterm -n "__fish_use_subcommand" -s V -l version -d 'Print version' complete -c wezterm -n "__fish_use_subcommand" -f -a "start" -d 'Start the GUI, optionally running an alternative program [aliases: -e]' +complete -c wezterm -n "__fish_use_subcommand" -f -a "blocking-start" -d 'Start the GUI in blocking mode. You shouldn\'t see this, but you may see it in shell completions because of this open clap issue: ' complete -c wezterm -n "__fish_use_subcommand" -f -a "ssh" -d 'Establish an ssh session' complete -c wezterm -n "__fish_use_subcommand" -f -a "serial" -d 'Open a serial port' complete -c wezterm -n "__fish_use_subcommand" -f -a "connect" -d 'Connect to wezterm multiplexer' @@ -27,6 +28,17 @@ complete -c wezterm -n "__fish_seen_subcommand_from start" -l new-tab -d 'When s complete -c wezterm -n "__fish_seen_subcommand_from start" -s e -d 'Dummy argument that consumes "-e" and does nothing. This is meant as a compatibility layer for supporting the widely adopted standard of passing the command to execute to the terminal via a "-e" option. This works because we then treat the remaining cmdline as trailing options, that will automatically be parsed via the existing "prog" option. This option exists only as a fallback. It is recommended to pass the command as a normal trailing command instead if possible' complete -c wezterm -n "__fish_seen_subcommand_from start" -l attach -d 'When used with --domain, if the domain already has running panes, wezterm will simply attach and will NOT spawn the specified PROG. If you omit --attach when using --domain, wezterm will attach AND then spawn PROG' complete -c wezterm -n "__fish_seen_subcommand_from start" -s h -l help -d 'Print help (see more with \'--help\')' +complete -c wezterm -n "__fish_seen_subcommand_from blocking-start" -l cwd -d 'Specify the current working directory for the initially spawned program' -r -f -a "(__fish_complete_directories)" +complete -c wezterm -n "__fish_seen_subcommand_from blocking-start" -l class -d 'Override the default windowing system class. The default is "org.wezfurlong.wezterm". Under X11 and Windows this changes the window class. Under Wayland this changes the app_id. This changes the class for all windows spawned by this instance of wezterm, including error, update and ssh authentication dialogs' -r +complete -c wezterm -n "__fish_seen_subcommand_from blocking-start" -l workspace -d 'Override the default workspace with the provided name. The default is "default"' -r +complete -c wezterm -n "__fish_seen_subcommand_from blocking-start" -l position -d 'Override the position for the initial window launched by this process.' -r +complete -c wezterm -n "__fish_seen_subcommand_from blocking-start" -l domain -d 'Name of the multiplexer domain section from the configuration to which you\'d like to connect. If omitted, the default domain will be used' -r +complete -c wezterm -n "__fish_seen_subcommand_from blocking-start" -l no-auto-connect -d 'If true, do not connect to domains marked as connect_automatically in your wezterm configuration file' +complete -c wezterm -n "__fish_seen_subcommand_from blocking-start" -l always-new-process -d 'If enabled, don\'t try to ask an existing wezterm GUI instance to start the command. Instead, always start the GUI in this invocation of wezterm so that you can wait for the command to complete by waiting for this wezterm process to finish' +complete -c wezterm -n "__fish_seen_subcommand_from blocking-start" -l new-tab -d 'When spawning into an existing GUI instance, spawn a new tab into the active window rather than spawn a new window' +complete -c wezterm -n "__fish_seen_subcommand_from blocking-start" -s e -d 'Dummy argument that consumes "-e" and does nothing. This is meant as a compatibility layer for supporting the widely adopted standard of passing the command to execute to the terminal via a "-e" option. This works because we then treat the remaining cmdline as trailing options, that will automatically be parsed via the existing "prog" option. This option exists only as a fallback. It is recommended to pass the command as a normal trailing command instead if possible' +complete -c wezterm -n "__fish_seen_subcommand_from blocking-start" -l attach -d 'When used with --domain, if the domain already has running panes, wezterm will simply attach and will NOT spawn the specified PROG. If you omit --attach when using --domain, wezterm will attach AND then spawn PROG' +complete -c wezterm -n "__fish_seen_subcommand_from blocking-start" -s h -l help -d 'Print help (see more with \'--help\')' complete -c wezterm -n "__fish_seen_subcommand_from ssh" -s o -l ssh-option -d 'Override specific SSH configuration options. `wezterm ssh` is able to parse some (but not all!) options from your `~/.ssh/config` and `/etc/ssh/ssh_config` files. This command line switch allows you to override or otherwise specify ssh_config style options' -r complete -c wezterm -n "__fish_seen_subcommand_from ssh" -l class -d 'Override the default windowing system class. The default is "org.wezfurlong.wezterm". Under X11 and Windows this changes the window class. Under Wayland this changes the app_id. This changes the class for all windows spawned by this instance of wezterm, including error, update and ssh authentication dialogs' -r complete -c wezterm -n "__fish_seen_subcommand_from ssh" -l position -d 'Override the position for the initial window launched by this process.' -r @@ -191,19 +203,20 @@ complete -c wezterm -n "__fish_seen_subcommand_from replay" -l cat -d 'Just emit complete -c wezterm -n "__fish_seen_subcommand_from replay" -s h -l help -d 'Print help' complete -c wezterm -n "__fish_seen_subcommand_from shell-completion" -l shell -d 'Which shell to generate for' -r -f -a "{bash '',elvish '',fish '',power-shell '',zsh '',fig ''}" complete -c wezterm -n "__fish_seen_subcommand_from shell-completion" -s h -l help -d 'Print help' -complete -c wezterm -n "__fish_seen_subcommand_from help; and not __fish_seen_subcommand_from start; and not __fish_seen_subcommand_from ssh; and not __fish_seen_subcommand_from serial; and not __fish_seen_subcommand_from connect; and not __fish_seen_subcommand_from ls-fonts; and not __fish_seen_subcommand_from show-keys; and not __fish_seen_subcommand_from cli; and not __fish_seen_subcommand_from imgcat; and not __fish_seen_subcommand_from set-working-directory; and not __fish_seen_subcommand_from record; and not __fish_seen_subcommand_from replay; and not __fish_seen_subcommand_from shell-completion; and not __fish_seen_subcommand_from help" -f -a "start" -d 'Start the GUI, optionally running an alternative program [aliases: -e]' -complete -c wezterm -n "__fish_seen_subcommand_from help; and not __fish_seen_subcommand_from start; and not __fish_seen_subcommand_from ssh; and not __fish_seen_subcommand_from serial; and not __fish_seen_subcommand_from connect; and not __fish_seen_subcommand_from ls-fonts; and not __fish_seen_subcommand_from show-keys; and not __fish_seen_subcommand_from cli; and not __fish_seen_subcommand_from imgcat; and not __fish_seen_subcommand_from set-working-directory; and not __fish_seen_subcommand_from record; and not __fish_seen_subcommand_from replay; and not __fish_seen_subcommand_from shell-completion; and not __fish_seen_subcommand_from help" -f -a "ssh" -d 'Establish an ssh session' -complete -c wezterm -n "__fish_seen_subcommand_from help; and not __fish_seen_subcommand_from start; and not __fish_seen_subcommand_from ssh; and not __fish_seen_subcommand_from serial; and not __fish_seen_subcommand_from connect; and not __fish_seen_subcommand_from ls-fonts; and not __fish_seen_subcommand_from show-keys; and not __fish_seen_subcommand_from cli; and not __fish_seen_subcommand_from imgcat; and not __fish_seen_subcommand_from set-working-directory; and not __fish_seen_subcommand_from record; and not __fish_seen_subcommand_from replay; and not __fish_seen_subcommand_from shell-completion; and not __fish_seen_subcommand_from help" -f -a "serial" -d 'Open a serial port' -complete -c wezterm -n "__fish_seen_subcommand_from help; and not __fish_seen_subcommand_from start; and not __fish_seen_subcommand_from ssh; and not __fish_seen_subcommand_from serial; and not __fish_seen_subcommand_from connect; and not __fish_seen_subcommand_from ls-fonts; and not __fish_seen_subcommand_from show-keys; and not __fish_seen_subcommand_from cli; and not __fish_seen_subcommand_from imgcat; and not __fish_seen_subcommand_from set-working-directory; and not __fish_seen_subcommand_from record; and not __fish_seen_subcommand_from replay; and not __fish_seen_subcommand_from shell-completion; and not __fish_seen_subcommand_from help" -f -a "connect" -d 'Connect to wezterm multiplexer' -complete -c wezterm -n "__fish_seen_subcommand_from help; and not __fish_seen_subcommand_from start; and not __fish_seen_subcommand_from ssh; and not __fish_seen_subcommand_from serial; and not __fish_seen_subcommand_from connect; and not __fish_seen_subcommand_from ls-fonts; and not __fish_seen_subcommand_from show-keys; and not __fish_seen_subcommand_from cli; and not __fish_seen_subcommand_from imgcat; and not __fish_seen_subcommand_from set-working-directory; and not __fish_seen_subcommand_from record; and not __fish_seen_subcommand_from replay; and not __fish_seen_subcommand_from shell-completion; and not __fish_seen_subcommand_from help" -f -a "ls-fonts" -d 'Display information about fonts' -complete -c wezterm -n "__fish_seen_subcommand_from help; and not __fish_seen_subcommand_from start; and not __fish_seen_subcommand_from ssh; and not __fish_seen_subcommand_from serial; and not __fish_seen_subcommand_from connect; and not __fish_seen_subcommand_from ls-fonts; and not __fish_seen_subcommand_from show-keys; and not __fish_seen_subcommand_from cli; and not __fish_seen_subcommand_from imgcat; and not __fish_seen_subcommand_from set-working-directory; and not __fish_seen_subcommand_from record; and not __fish_seen_subcommand_from replay; and not __fish_seen_subcommand_from shell-completion; and not __fish_seen_subcommand_from help" -f -a "show-keys" -d 'Show key assignments' -complete -c wezterm -n "__fish_seen_subcommand_from help; and not __fish_seen_subcommand_from start; and not __fish_seen_subcommand_from ssh; and not __fish_seen_subcommand_from serial; and not __fish_seen_subcommand_from connect; and not __fish_seen_subcommand_from ls-fonts; and not __fish_seen_subcommand_from show-keys; and not __fish_seen_subcommand_from cli; and not __fish_seen_subcommand_from imgcat; and not __fish_seen_subcommand_from set-working-directory; and not __fish_seen_subcommand_from record; and not __fish_seen_subcommand_from replay; and not __fish_seen_subcommand_from shell-completion; and not __fish_seen_subcommand_from help" -f -a "cli" -d 'Interact with experimental mux server' -complete -c wezterm -n "__fish_seen_subcommand_from help; and not __fish_seen_subcommand_from start; and not __fish_seen_subcommand_from ssh; and not __fish_seen_subcommand_from serial; and not __fish_seen_subcommand_from connect; and not __fish_seen_subcommand_from ls-fonts; and not __fish_seen_subcommand_from show-keys; and not __fish_seen_subcommand_from cli; and not __fish_seen_subcommand_from imgcat; and not __fish_seen_subcommand_from set-working-directory; and not __fish_seen_subcommand_from record; and not __fish_seen_subcommand_from replay; and not __fish_seen_subcommand_from shell-completion; and not __fish_seen_subcommand_from help" -f -a "imgcat" -d 'Output an image to the terminal' -complete -c wezterm -n "__fish_seen_subcommand_from help; and not __fish_seen_subcommand_from start; and not __fish_seen_subcommand_from ssh; and not __fish_seen_subcommand_from serial; and not __fish_seen_subcommand_from connect; and not __fish_seen_subcommand_from ls-fonts; and not __fish_seen_subcommand_from show-keys; and not __fish_seen_subcommand_from cli; and not __fish_seen_subcommand_from imgcat; and not __fish_seen_subcommand_from set-working-directory; and not __fish_seen_subcommand_from record; and not __fish_seen_subcommand_from replay; and not __fish_seen_subcommand_from shell-completion; and not __fish_seen_subcommand_from help" -f -a "set-working-directory" -d 'Advise the terminal of the current working directory by emitting an OSC 7 escape sequence' -complete -c wezterm -n "__fish_seen_subcommand_from help; and not __fish_seen_subcommand_from start; and not __fish_seen_subcommand_from ssh; and not __fish_seen_subcommand_from serial; and not __fish_seen_subcommand_from connect; and not __fish_seen_subcommand_from ls-fonts; and not __fish_seen_subcommand_from show-keys; and not __fish_seen_subcommand_from cli; and not __fish_seen_subcommand_from imgcat; and not __fish_seen_subcommand_from set-working-directory; and not __fish_seen_subcommand_from record; and not __fish_seen_subcommand_from replay; and not __fish_seen_subcommand_from shell-completion; and not __fish_seen_subcommand_from help" -f -a "record" -d 'Record a terminal session as an asciicast' -complete -c wezterm -n "__fish_seen_subcommand_from help; and not __fish_seen_subcommand_from start; and not __fish_seen_subcommand_from ssh; and not __fish_seen_subcommand_from serial; and not __fish_seen_subcommand_from connect; and not __fish_seen_subcommand_from ls-fonts; and not __fish_seen_subcommand_from show-keys; and not __fish_seen_subcommand_from cli; and not __fish_seen_subcommand_from imgcat; and not __fish_seen_subcommand_from set-working-directory; and not __fish_seen_subcommand_from record; and not __fish_seen_subcommand_from replay; and not __fish_seen_subcommand_from shell-completion; and not __fish_seen_subcommand_from help" -f -a "replay" -d 'Replay an asciicast terminal session' -complete -c wezterm -n "__fish_seen_subcommand_from help; and not __fish_seen_subcommand_from start; and not __fish_seen_subcommand_from ssh; and not __fish_seen_subcommand_from serial; and not __fish_seen_subcommand_from connect; and not __fish_seen_subcommand_from ls-fonts; and not __fish_seen_subcommand_from show-keys; and not __fish_seen_subcommand_from cli; and not __fish_seen_subcommand_from imgcat; and not __fish_seen_subcommand_from set-working-directory; and not __fish_seen_subcommand_from record; and not __fish_seen_subcommand_from replay; and not __fish_seen_subcommand_from shell-completion; and not __fish_seen_subcommand_from help" -f -a "shell-completion" -d 'Generate shell completion information' -complete -c wezterm -n "__fish_seen_subcommand_from help; and not __fish_seen_subcommand_from start; and not __fish_seen_subcommand_from ssh; and not __fish_seen_subcommand_from serial; and not __fish_seen_subcommand_from connect; and not __fish_seen_subcommand_from ls-fonts; and not __fish_seen_subcommand_from show-keys; and not __fish_seen_subcommand_from cli; and not __fish_seen_subcommand_from imgcat; and not __fish_seen_subcommand_from set-working-directory; and not __fish_seen_subcommand_from record; and not __fish_seen_subcommand_from replay; and not __fish_seen_subcommand_from shell-completion; and not __fish_seen_subcommand_from help" -f -a "help" -d 'Print this message or the help of the given subcommand(s)' +complete -c wezterm -n "__fish_seen_subcommand_from help; and not __fish_seen_subcommand_from start; and not __fish_seen_subcommand_from blocking-start; and not __fish_seen_subcommand_from ssh; and not __fish_seen_subcommand_from serial; and not __fish_seen_subcommand_from connect; and not __fish_seen_subcommand_from ls-fonts; and not __fish_seen_subcommand_from show-keys; and not __fish_seen_subcommand_from cli; and not __fish_seen_subcommand_from imgcat; and not __fish_seen_subcommand_from set-working-directory; and not __fish_seen_subcommand_from record; and not __fish_seen_subcommand_from replay; and not __fish_seen_subcommand_from shell-completion; and not __fish_seen_subcommand_from help" -f -a "start" -d 'Start the GUI, optionally running an alternative program [aliases: -e]' +complete -c wezterm -n "__fish_seen_subcommand_from help; and not __fish_seen_subcommand_from start; and not __fish_seen_subcommand_from blocking-start; and not __fish_seen_subcommand_from ssh; and not __fish_seen_subcommand_from serial; and not __fish_seen_subcommand_from connect; and not __fish_seen_subcommand_from ls-fonts; and not __fish_seen_subcommand_from show-keys; and not __fish_seen_subcommand_from cli; and not __fish_seen_subcommand_from imgcat; and not __fish_seen_subcommand_from set-working-directory; and not __fish_seen_subcommand_from record; and not __fish_seen_subcommand_from replay; and not __fish_seen_subcommand_from shell-completion; and not __fish_seen_subcommand_from help" -f -a "blocking-start" -d 'Start the GUI in blocking mode. You shouldn\'t see this, but you may see it in shell completions because of this open clap issue: ' +complete -c wezterm -n "__fish_seen_subcommand_from help; and not __fish_seen_subcommand_from start; and not __fish_seen_subcommand_from blocking-start; and not __fish_seen_subcommand_from ssh; and not __fish_seen_subcommand_from serial; and not __fish_seen_subcommand_from connect; and not __fish_seen_subcommand_from ls-fonts; and not __fish_seen_subcommand_from show-keys; and not __fish_seen_subcommand_from cli; and not __fish_seen_subcommand_from imgcat; and not __fish_seen_subcommand_from set-working-directory; and not __fish_seen_subcommand_from record; and not __fish_seen_subcommand_from replay; and not __fish_seen_subcommand_from shell-completion; and not __fish_seen_subcommand_from help" -f -a "ssh" -d 'Establish an ssh session' +complete -c wezterm -n "__fish_seen_subcommand_from help; and not __fish_seen_subcommand_from start; and not __fish_seen_subcommand_from blocking-start; and not __fish_seen_subcommand_from ssh; and not __fish_seen_subcommand_from serial; and not __fish_seen_subcommand_from connect; and not __fish_seen_subcommand_from ls-fonts; and not __fish_seen_subcommand_from show-keys; and not __fish_seen_subcommand_from cli; and not __fish_seen_subcommand_from imgcat; and not __fish_seen_subcommand_from set-working-directory; and not __fish_seen_subcommand_from record; and not __fish_seen_subcommand_from replay; and not __fish_seen_subcommand_from shell-completion; and not __fish_seen_subcommand_from help" -f -a "serial" -d 'Open a serial port' +complete -c wezterm -n "__fish_seen_subcommand_from help; and not __fish_seen_subcommand_from start; and not __fish_seen_subcommand_from blocking-start; and not __fish_seen_subcommand_from ssh; and not __fish_seen_subcommand_from serial; and not __fish_seen_subcommand_from connect; and not __fish_seen_subcommand_from ls-fonts; and not __fish_seen_subcommand_from show-keys; and not __fish_seen_subcommand_from cli; and not __fish_seen_subcommand_from imgcat; and not __fish_seen_subcommand_from set-working-directory; and not __fish_seen_subcommand_from record; and not __fish_seen_subcommand_from replay; and not __fish_seen_subcommand_from shell-completion; and not __fish_seen_subcommand_from help" -f -a "connect" -d 'Connect to wezterm multiplexer' +complete -c wezterm -n "__fish_seen_subcommand_from help; and not __fish_seen_subcommand_from start; and not __fish_seen_subcommand_from blocking-start; and not __fish_seen_subcommand_from ssh; and not __fish_seen_subcommand_from serial; and not __fish_seen_subcommand_from connect; and not __fish_seen_subcommand_from ls-fonts; and not __fish_seen_subcommand_from show-keys; and not __fish_seen_subcommand_from cli; and not __fish_seen_subcommand_from imgcat; and not __fish_seen_subcommand_from set-working-directory; and not __fish_seen_subcommand_from record; and not __fish_seen_subcommand_from replay; and not __fish_seen_subcommand_from shell-completion; and not __fish_seen_subcommand_from help" -f -a "ls-fonts" -d 'Display information about fonts' +complete -c wezterm -n "__fish_seen_subcommand_from help; and not __fish_seen_subcommand_from start; and not __fish_seen_subcommand_from blocking-start; and not __fish_seen_subcommand_from ssh; and not __fish_seen_subcommand_from serial; and not __fish_seen_subcommand_from connect; and not __fish_seen_subcommand_from ls-fonts; and not __fish_seen_subcommand_from show-keys; and not __fish_seen_subcommand_from cli; and not __fish_seen_subcommand_from imgcat; and not __fish_seen_subcommand_from set-working-directory; and not __fish_seen_subcommand_from record; and not __fish_seen_subcommand_from replay; and not __fish_seen_subcommand_from shell-completion; and not __fish_seen_subcommand_from help" -f -a "show-keys" -d 'Show key assignments' +complete -c wezterm -n "__fish_seen_subcommand_from help; and not __fish_seen_subcommand_from start; and not __fish_seen_subcommand_from blocking-start; and not __fish_seen_subcommand_from ssh; and not __fish_seen_subcommand_from serial; and not __fish_seen_subcommand_from connect; and not __fish_seen_subcommand_from ls-fonts; and not __fish_seen_subcommand_from show-keys; and not __fish_seen_subcommand_from cli; and not __fish_seen_subcommand_from imgcat; and not __fish_seen_subcommand_from set-working-directory; and not __fish_seen_subcommand_from record; and not __fish_seen_subcommand_from replay; and not __fish_seen_subcommand_from shell-completion; and not __fish_seen_subcommand_from help" -f -a "cli" -d 'Interact with experimental mux server' +complete -c wezterm -n "__fish_seen_subcommand_from help; and not __fish_seen_subcommand_from start; and not __fish_seen_subcommand_from blocking-start; and not __fish_seen_subcommand_from ssh; and not __fish_seen_subcommand_from serial; and not __fish_seen_subcommand_from connect; and not __fish_seen_subcommand_from ls-fonts; and not __fish_seen_subcommand_from show-keys; and not __fish_seen_subcommand_from cli; and not __fish_seen_subcommand_from imgcat; and not __fish_seen_subcommand_from set-working-directory; and not __fish_seen_subcommand_from record; and not __fish_seen_subcommand_from replay; and not __fish_seen_subcommand_from shell-completion; and not __fish_seen_subcommand_from help" -f -a "imgcat" -d 'Output an image to the terminal' +complete -c wezterm -n "__fish_seen_subcommand_from help; and not __fish_seen_subcommand_from start; and not __fish_seen_subcommand_from blocking-start; and not __fish_seen_subcommand_from ssh; and not __fish_seen_subcommand_from serial; and not __fish_seen_subcommand_from connect; and not __fish_seen_subcommand_from ls-fonts; and not __fish_seen_subcommand_from show-keys; and not __fish_seen_subcommand_from cli; and not __fish_seen_subcommand_from imgcat; and not __fish_seen_subcommand_from set-working-directory; and not __fish_seen_subcommand_from record; and not __fish_seen_subcommand_from replay; and not __fish_seen_subcommand_from shell-completion; and not __fish_seen_subcommand_from help" -f -a "set-working-directory" -d 'Advise the terminal of the current working directory by emitting an OSC 7 escape sequence' +complete -c wezterm -n "__fish_seen_subcommand_from help; and not __fish_seen_subcommand_from start; and not __fish_seen_subcommand_from blocking-start; and not __fish_seen_subcommand_from ssh; and not __fish_seen_subcommand_from serial; and not __fish_seen_subcommand_from connect; and not __fish_seen_subcommand_from ls-fonts; and not __fish_seen_subcommand_from show-keys; and not __fish_seen_subcommand_from cli; and not __fish_seen_subcommand_from imgcat; and not __fish_seen_subcommand_from set-working-directory; and not __fish_seen_subcommand_from record; and not __fish_seen_subcommand_from replay; and not __fish_seen_subcommand_from shell-completion; and not __fish_seen_subcommand_from help" -f -a "record" -d 'Record a terminal session as an asciicast' +complete -c wezterm -n "__fish_seen_subcommand_from help; and not __fish_seen_subcommand_from start; and not __fish_seen_subcommand_from blocking-start; and not __fish_seen_subcommand_from ssh; and not __fish_seen_subcommand_from serial; and not __fish_seen_subcommand_from connect; and not __fish_seen_subcommand_from ls-fonts; and not __fish_seen_subcommand_from show-keys; and not __fish_seen_subcommand_from cli; and not __fish_seen_subcommand_from imgcat; and not __fish_seen_subcommand_from set-working-directory; and not __fish_seen_subcommand_from record; and not __fish_seen_subcommand_from replay; and not __fish_seen_subcommand_from shell-completion; and not __fish_seen_subcommand_from help" -f -a "replay" -d 'Replay an asciicast terminal session' +complete -c wezterm -n "__fish_seen_subcommand_from help; and not __fish_seen_subcommand_from start; and not __fish_seen_subcommand_from blocking-start; and not __fish_seen_subcommand_from ssh; and not __fish_seen_subcommand_from serial; and not __fish_seen_subcommand_from connect; and not __fish_seen_subcommand_from ls-fonts; and not __fish_seen_subcommand_from show-keys; and not __fish_seen_subcommand_from cli; and not __fish_seen_subcommand_from imgcat; and not __fish_seen_subcommand_from set-working-directory; and not __fish_seen_subcommand_from record; and not __fish_seen_subcommand_from replay; and not __fish_seen_subcommand_from shell-completion; and not __fish_seen_subcommand_from help" -f -a "shell-completion" -d 'Generate shell completion information' +complete -c wezterm -n "__fish_seen_subcommand_from help; and not __fish_seen_subcommand_from start; and not __fish_seen_subcommand_from blocking-start; and not __fish_seen_subcommand_from ssh; and not __fish_seen_subcommand_from serial; and not __fish_seen_subcommand_from connect; and not __fish_seen_subcommand_from ls-fonts; and not __fish_seen_subcommand_from show-keys; and not __fish_seen_subcommand_from cli; and not __fish_seen_subcommand_from imgcat; and not __fish_seen_subcommand_from set-working-directory; and not __fish_seen_subcommand_from record; and not __fish_seen_subcommand_from replay; and not __fish_seen_subcommand_from shell-completion; and not __fish_seen_subcommand_from help" -f -a "help" -d 'Print this message or the help of the given subcommand(s)' complete -c wezterm -n "__fish_seen_subcommand_from help; and __fish_seen_subcommand_from cli; and not __fish_seen_subcommand_from list; and not __fish_seen_subcommand_from list-clients; and not __fish_seen_subcommand_from proxy; and not __fish_seen_subcommand_from tlscreds; and not __fish_seen_subcommand_from move-pane-to-new-tab; and not __fish_seen_subcommand_from split-pane; and not __fish_seen_subcommand_from spawn; and not __fish_seen_subcommand_from send-text; and not __fish_seen_subcommand_from get-text; and not __fish_seen_subcommand_from activate-pane-direction; and not __fish_seen_subcommand_from get-pane-direction; and not __fish_seen_subcommand_from kill-pane; and not __fish_seen_subcommand_from activate-pane; and not __fish_seen_subcommand_from adjust-pane-size; and not __fish_seen_subcommand_from activate-tab; and not __fish_seen_subcommand_from set-tab-title; and not __fish_seen_subcommand_from set-window-title; and not __fish_seen_subcommand_from rename-workspace; and not __fish_seen_subcommand_from zoom-pane" -f -a "list" -d 'list windows, tabs and panes' complete -c wezterm -n "__fish_seen_subcommand_from help; and __fish_seen_subcommand_from cli; and not __fish_seen_subcommand_from list; and not __fish_seen_subcommand_from list-clients; and not __fish_seen_subcommand_from proxy; and not __fish_seen_subcommand_from tlscreds; and not __fish_seen_subcommand_from move-pane-to-new-tab; and not __fish_seen_subcommand_from split-pane; and not __fish_seen_subcommand_from spawn; and not __fish_seen_subcommand_from send-text; and not __fish_seen_subcommand_from get-text; and not __fish_seen_subcommand_from activate-pane-direction; and not __fish_seen_subcommand_from get-pane-direction; and not __fish_seen_subcommand_from kill-pane; and not __fish_seen_subcommand_from activate-pane; and not __fish_seen_subcommand_from adjust-pane-size; and not __fish_seen_subcommand_from activate-tab; and not __fish_seen_subcommand_from set-tab-title; and not __fish_seen_subcommand_from set-window-title; and not __fish_seen_subcommand_from rename-workspace; and not __fish_seen_subcommand_from zoom-pane" -f -a "list-clients" -d 'list clients' complete -c wezterm -n "__fish_seen_subcommand_from help; and __fish_seen_subcommand_from cli; and not __fish_seen_subcommand_from list; and not __fish_seen_subcommand_from list-clients; and not __fish_seen_subcommand_from proxy; and not __fish_seen_subcommand_from tlscreds; and not __fish_seen_subcommand_from move-pane-to-new-tab; and not __fish_seen_subcommand_from split-pane; and not __fish_seen_subcommand_from spawn; and not __fish_seen_subcommand_from send-text; and not __fish_seen_subcommand_from get-text; and not __fish_seen_subcommand_from activate-pane-direction; and not __fish_seen_subcommand_from get-pane-direction; and not __fish_seen_subcommand_from kill-pane; and not __fish_seen_subcommand_from activate-pane; and not __fish_seen_subcommand_from adjust-pane-size; and not __fish_seen_subcommand_from activate-tab; and not __fish_seen_subcommand_from set-tab-title; and not __fish_seen_subcommand_from set-window-title; and not __fish_seen_subcommand_from rename-workspace; and not __fish_seen_subcommand_from zoom-pane" -f -a "proxy" -d 'start rpc proxy pipe' diff --git a/assets/shell-completion/zsh b/assets/shell-completion/zsh index db7569a2e78..69d619cbc0d 100644 --- a/assets/shell-completion/zsh +++ b/assets/shell-completion/zsh @@ -49,6 +49,23 @@ _arguments "${_arguments_options[@]}" \ '*::prog -- Instead of executing your shell, run PROG. For example\: `wezterm start -- bash -l` will spawn bash as if it were a login shell. \[aliases\: -e\]:_cmdambivalent' \ && ret=0 ;; +(blocking-start) +_arguments "${_arguments_options[@]}" \ +'--cwd=[Specify the current working directory for the initially spawned program]:CWD:_files -/' \ +'--class=[Override the default windowing system class. The default is "org.wezfurlong.wezterm". Under X11 and Windows this changes the window class. Under Wayland this changes the app_id. This changes the class for all windows spawned by this instance of wezterm, including error, update and ssh authentication dialogs]:CLASS: ' \ +'--workspace=[Override the default workspace with the provided name. The default is "default"]:WORKSPACE: ' \ +'--position=[Override the position for the initial window launched by this process.]:POSITION: ' \ +'--domain=[Name of the multiplexer domain section from the configuration to which you'\''d like to connect. If omitted, the default domain will be used]:DOMAIN: ' \ +'--no-auto-connect[If true, do not connect to domains marked as connect_automatically in your wezterm configuration file]' \ +'--always-new-process[If enabled, don'\''t try to ask an existing wezterm GUI instance to start the command. Instead, always start the GUI in this invocation of wezterm so that you can wait for the command to complete by waiting for this wezterm process to finish]' \ +'(--always-new-process)--new-tab[When spawning into an existing GUI instance, spawn a new tab into the active window rather than spawn a new window]' \ +'-e[Dummy argument that consumes "-e" and does nothing. This is meant as a compatibility layer for supporting the widely adopted standard of passing the command to execute to the terminal via a "-e" option. This works because we then treat the remaining cmdline as trailing options, that will automatically be parsed via the existing "prog" option. This option exists only as a fallback. It is recommended to pass the command as a normal trailing command instead if possible]' \ +'--attach[When used with --domain, if the domain already has running panes, wezterm will simply attach and will NOT spawn the specified PROG. If you omit --attach when using --domain, wezterm will attach AND then spawn PROG]' \ +'-h[Print help (see more with '\''--help'\'')]' \ +'--help[Print help (see more with '\''--help'\'')]' \ +'*::prog -- Instead of executing your shell, run PROG. For example\: `wezterm start -- bash -l` will spawn bash as if it were a login shell. \[aliases\: -e\]:_cmdambivalent' \ +&& ret=0 +;; (ssh) _arguments "${_arguments_options[@]}" \ '*-o+[Override specific SSH configuration options. \`wezterm ssh\` is able to parse some (but not all!) options from your \`~/.ssh/config\` and \`/etc/ssh/ssh_config\` files. This command line switch allows you to override or otherwise specify ssh_config style options]:name=value: ' \ @@ -463,6 +480,10 @@ _arguments "${_arguments_options[@]}" \ _arguments "${_arguments_options[@]}" \ && ret=0 ;; +(blocking-start) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; (ssh) _arguments "${_arguments_options[@]}" \ && ret=0 @@ -612,6 +633,7 @@ esac _wezterm_commands() { local commands; commands=( 'start:Start the GUI, optionally running an alternative program \[aliases\: -e\]' \ +'blocking-start:Start the GUI in blocking mode. You shouldn'\''t see this, but you may see it in shell completions because of this open clap issue\: ' \ 'ssh:Establish an ssh session' \ 'serial:Open a serial port' \ 'connect:Connect to wezterm multiplexer' \ @@ -687,6 +709,16 @@ _wezterm__help__cli__adjust-pane-size_commands() { local commands; commands=() _describe -t commands 'wezterm help cli adjust-pane-size commands' commands "$@" } +(( $+functions[_wezterm__blocking-start_commands] )) || +_wezterm__blocking-start_commands() { + local commands; commands=() + _describe -t commands 'wezterm blocking-start commands' commands "$@" +} +(( $+functions[_wezterm__help__blocking-start_commands] )) || +_wezterm__help__blocking-start_commands() { + local commands; commands=() + _describe -t commands 'wezterm help blocking-start commands' commands "$@" +} (( $+functions[_wezterm__cli_commands] )) || _wezterm__cli_commands() { local commands; commands=( @@ -819,6 +851,7 @@ _wezterm__cli__help__help_commands() { _wezterm__help_commands() { local commands; commands=( 'start:Start the GUI, optionally running an alternative program \[aliases\: -e\]' \ +'blocking-start:Start the GUI in blocking mode. You shouldn'\''t see this, but you may see it in shell completions because of this open clap issue\: ' \ 'ssh:Establish an ssh session' \ 'serial:Open a serial port' \ 'connect:Connect to wezterm multiplexer' \ diff --git a/docs/changelog.md b/docs/changelog.md index 367cb138207..3d99d1d473d 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -25,6 +25,8 @@ As features stabilize some brief notes about them will accumulate here. * The default for [freetype_load_flags](config/lua/config/freetype_load_flags.md) is now `NO_HINTING` when the dpi is >= 100, otherwise `DEFAULT`. #4902 +* `wezterm -e` will now wait for the spawned program to terminate before + it will itself terminate. Thanks to @vimpostor! #4535 #4523 #### New * We now show the Lua version in the debug overlay. Thanks to @bbkane! #4943 * `wezterm start --new-tab` and `wezterm connect --new-tab` to request a new diff --git a/wezterm-gui/src/main.rs b/wezterm-gui/src/main.rs index 9d2945577c3..0514c668d79 100644 --- a/wezterm-gui/src/main.rs +++ b/wezterm-gui/src/main.rs @@ -110,6 +110,9 @@ enum SubCommand { )] Start(StartCommand), + /// Start the GUI in blocking mode. You shouldn't see this, but you + /// may see it in shell completions because of this open clap issue: + /// #[command(short_flag_alias = 'e', hide = true)] BlockingStart(StartCommand), diff --git a/wezterm/src/main.rs b/wezterm/src/main.rs index 282ed572fac..0fdb3434876 100644 --- a/wezterm/src/main.rs +++ b/wezterm/src/main.rs @@ -95,6 +95,12 @@ enum SubCommand { )] Start(StartCommand), + /// Start the GUI in blocking mode. You shouldn't see this, but you + /// may see it in shell completions because of this open clap issue: + /// + #[command(short_flag_alias = 'e', hide = true)] + BlockingStart(StartCommand), + #[command(name = "ssh", about = "Establish an ssh session")] Ssh(SshCommand), @@ -728,6 +734,7 @@ fn run() -> anyhow::Result<()> { .unwrap_or_else(|| SubCommand::Start(StartCommand::default())) { SubCommand::Start(_) + | SubCommand::BlockingStart(_) | SubCommand::LsFonts(_) | SubCommand::ShowKeys(_) | SubCommand::Ssh(_)