aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/dot_config/zsh
diff options
context:
space:
mode:
authorLibravatar sommerfeld <sommerfeld@sommerfeld.dev>2026-05-13 13:43:13 +0100
committerLibravatar sommerfeld <sommerfeld@sommerfeld.dev>2026-05-13 13:43:13 +0100
commit82e8a5693745ea64b1018c8975f475998f20be17 (patch)
treecc99b1adf5c2a37462c3952a595cc5ca322ed4f5 /dot_config/zsh
parentbcb3792e45de4b880013cc2ed0f4c2bfccb1671c (diff)
downloaddotfiles-82e8a5693745ea64b1018c8975f475998f20be17.tar.gz
dotfiles-82e8a5693745ea64b1018c8975f475998f20be17.tar.bz2
dotfiles-82e8a5693745ea64b1018c8975f475998f20be17.zip
fix(zsh): preserve newlines in copy-last-output
Double-quoting a zsh array slice joins elements with spaces; use the (F) parameter expansion flag to join with newlines instead.
Diffstat (limited to 'dot_config/zsh')
-rw-r--r--dot_config/zsh/dot_zshrc2
1 files changed, 1 insertions, 1 deletions
diff --git a/dot_config/zsh/dot_zshrc b/dot_config/zsh/dot_zshrc
index db9fa85..f516495 100644
--- a/dot_config/zsh/dot_zshrc
+++ b/dot_config/zsh/dot_zshrc
@@ -274,7 +274,7 @@ copy-last-output() {
zle -M "copy-last-output: previous command produced no output"
return 0
fi
- printf '%s\n' "${lines[start,end]}" | wl-copy
+ print -r -- "${(F)lines[start,end]}" | wl-copy
zle -M "copied $((end - start + 1)) line(s) of last command output"
}
zle -N copy-last-output