From 82e8a5693745ea64b1018c8975f475998f20be17 Mon Sep 17 00:00:00 2001 From: sommerfeld Date: Wed, 13 May 2026 13:43:13 +0100 Subject: 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. --- dot_config/zsh/dot_zshrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'dot_config/zsh/dot_zshrc') 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 -- cgit v1.3.1