1
0
mirror of https://github.com/Tarrasch/zsh-autoenv.git synced 2025-12-17 03:25:12 +02:00

Fix stashing aliases with a space in double quotes

This commit is contained in:
Peter Toth
2024-06-21 01:04:08 +04:00
parent f5951dd0cf
commit 4069af9cd0
2 changed files with 5 additions and 4 deletions

View File

@@ -108,6 +108,7 @@ function stash() {
local alias_def="$(eval alias $stash_which 2>/dev/null)"
if [[ -n $alias_def ]]; then
alias_def=${alias_def#alias }
alias_def=$(echo "$alias_def" | sed 's/"/\\&/g') # Escape double quotes
eval "__varstash_alias__$stash_name=\"$alias_def\""
local stashed=1
fi