From 07b829c894738e4ad594dc5f8d73401fbd83f203 Mon Sep 17 00:00:00 2001 From: Marc Cornellà Date: Mon, 21 Feb 2022 18:34:28 +0100 Subject: fix(vcs_info): quote % in relevant fields on all current Zsh releases --- lib/vcs_info.zsh | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'lib') diff --git a/lib/vcs_info.zsh b/lib/vcs_info.zsh index 01dcd90b6..edb515ce0 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[] items just before they are used # in the line "VCS_INFO_hook 'post-backend'" of the VCS_INFO_formats -- cgit v1.2.3-70-g09d2 From b00b59364a019894ee4b9ba4062d922fedaa5ccd Mon Sep 17 00:00:00 2001 From: Marc Cornellà Date: Mon, 21 Feb 2022 20:28:40 +0100 Subject: fix(vcs_info): don't patch VCS_INFO_formats if not found --- lib/vcs_info.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/vcs_info.zsh b/lib/vcs_info.zsh index edb515ce0..e60938c14 100644 --- a/lib/vcs_info.zsh +++ b/lib/vcs_info.zsh @@ -38,7 +38,7 @@ # 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]//\%/%%}"' -- cgit v1.2.3-70-g09d2 From 99460351eb8d8d9d5ea2e44b66e1b9ceaaa4a368 Mon Sep 17 00:00:00 2001 From: "Markus (Vock) Arians" Date: Fri, 25 Feb 2022 13:29:22 +0100 Subject: feat(lib): support auto title in foot terminal (#10735) Co-authored-by: Markus Arians --- lib/termsupport.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') 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 ;; -- cgit v1.2.3-70-g09d2 From 141d06b602b670638a6354e05686e5d3bc56d1a6 Mon Sep 17 00:00:00 2001 From: Carlo Sala Date: Thu, 31 Mar 2022 09:27:58 +0200 Subject: fix(cli): turn of `commit.gpgsign` compatibly with git v1.7.1 (#10679) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Marc Cornellà --- lib/cli.zsh | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) (limited to 'lib') 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." -- cgit v1.2.3-70-g09d2