From 7b5147ef5e72b4af3814777b3959d0bf08ed2928 Mon Sep 17 00:00:00 2001 From: 2f38b454 <948336+fossilet@users.noreply.github.com> Date: Sat, 25 Apr 2026 12:43:50 +0800 Subject: [PATCH] fix(globalias): escape backslash to prevent alias expansion When typing a backslash followed by a character, globalias was incorrectly triggering alias expansion. Add early return when the last word starts with backslash to allow literal character insertion. --- plugins/globalias/globalias.plugin.zsh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugins/globalias/globalias.plugin.zsh b/plugins/globalias/globalias.plugin.zsh index bd27d589d..aee700813 100644 --- a/plugins/globalias/globalias.plugin.zsh +++ b/plugins/globalias/globalias.plugin.zsh @@ -3,6 +3,10 @@ globalias() { # (z) splits into words using shell parsing # (A) makes it an array even if there's only one element local word=${${(Az)LBUFFER}[-1]} + if [[ $word[1] == '\' ]]; then + zle self-insert + return + fi if [[ $GLOBALIAS_FILTER_VALUES[(Ie)$word] -eq 0 ]]; then zle _expand_alias zle expand-word