diff options
| author | 2026-05-13 13:43:13 +0100 | |
|---|---|---|
| committer | 2026-05-13 13:43:13 +0100 | |
| commit | 82e8a5693745ea64b1018c8975f475998f20be17 (patch) | |
| tree | cc99b1adf5c2a37462c3952a595cc5ca322ed4f5 /dot_config/zsh | |
| parent | bcb3792e45de4b880013cc2ed0f4c2bfccb1671c (diff) | |
| download | dotfiles-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_zshrc | 2 |
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 |
