diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/cli.zsh | 27 | ||||
-rw-r--r-- | lib/termsupport.zsh | 2 | ||||
-rw-r--r-- | lib/vcs_info.zsh | 15 |
3 files changed, 31 insertions, 13 deletions
diff --git a/lib/cli.zsh b/lib/cli.zsh index c2fba8556..bf783d9f3 100644 --- a/lib/cli.zsh +++ b/lib/cli.zsh @@ -573,12 +573,27 @@ function _omz::pr::test { # Rebase pull request branch against the current master _omz::log info "rebasing PR #$1..." - command git rebase --no-gpg-sign master ohmyzsh/pull-$1 || { - command git rebase --abort &>/dev/null - _omz::log warn "could not rebase PR #$1 on top of master." - _omz::log warn "you might not see the latest stable changes." - _omz::log info "run \`zsh\` to test the changes." - return 1 + local gpgsign + { + # Back up commit.gpgsign setting: use --local to get the current repository + # setting, not the global one. If --local is not a known option, it will + # exit with a 129 status code. + gpgsign=$(command git config --local commit.gpgsign 2>/dev/null) + [[ $? -ne 129 ]] || gpgsign=$(command git config commit.gpgsign 2>/dev/null) + command git config commit.gpgsign false + + command git rebase master ohmyzsh/pull-$1 || { + command git rebase --abort &>/dev/null + _omz::log warn "could not rebase PR #$1 on top of master." + _omz::log warn "you might not see the latest stable changes." + _omz::log info "run \`zsh\` to test the changes." + return 1 + } + } always { + case "$gpgsign" in + "") command git config --unset commit.gpgsign ;; + *) command git config commit.gpgsign "$gpgsign" ;; + esac } _omz::log info "fetch of PR #${1} successful." diff --git a/lib/termsupport.zsh b/lib/termsupport.zsh index 4035d10a1..80ca7ef78 100644 --- a/lib/termsupport.zsh +++ b/lib/termsupport.zsh @@ -17,7 +17,7 @@ function title { : ${2=$1} case "$TERM" in - cygwin|xterm*|putty*|rxvt*|konsole*|ansi|mlterm*|alacritty|st*) + cygwin|xterm*|putty*|rxvt*|konsole*|ansi|mlterm*|alacritty|st*|foot) print -Pn "\e]2;${2:q}\a" # set window name print -Pn "\e]1;${1:q}\a" # set tab name ;; diff --git a/lib/vcs_info.zsh b/lib/vcs_info.zsh index 01dcd90b6..e60938c14 100644 --- a/lib/vcs_info.zsh +++ b/lib/vcs_info.zsh @@ -1,8 +1,11 @@ -# Impacted versions go from v5.0.3 to v5.8 (v5.8.1 is the first patched version) -autoload -Uz is-at-least -if is-at-least 5.8.1 || ! is-at-least 5.0.3; then - return -fi +# Don't skip this file until a Zsh release does the necessary quoting. +# This is because even though 5.8.1 undid recursive prompt_subst inside +# prompt sequences, % characters in relevant fields will still be rendered +# incorrectly in vcs_info, on all Zsh releases up to writing this. +# +# There is no release yet that does this right, since it requires changing +# how what vcs_info hooks expect to receive. Even so, I'd rather be correct +# and break custom vcs_info hooks than have a broken prompt. # Quote necessary $hook_com[<field>] items just before they are used # in the line "VCS_INFO_hook 'post-backend'" of the VCS_INFO_formats @@ -35,7 +38,7 @@ fi # due to malicious input as a consequence of CVE-2021-45444, which affects # zsh versions from 5.0.3 to 5.8. # -autoload -Uz +X regexp-replace VCS_INFO_formats +autoload -Uz +X regexp-replace VCS_INFO_formats 2>/dev/null || return # We use $tmp here because it's already a local variable in VCS_INFO_formats typeset PATCH='for tmp (base base-name branch misc revision subdir) hook_com[$tmp]="${hook_com[$tmp]//\%/%%}"' |