Is this a pbcopy
command garbled bug?
If so, is there a way to fix it?
I've tried a few ways but still can't found why this is happened.
Steps to reproduce
# 1. copy output
$ man grep | pbcopy
# 2. paste to a markdown file
# 3. view the markdown file
using vscode
open the markdown
file, still garbled
# stdout
$ man ls > man-ls.md
# $ man grep > man-grep.md
# no pagination problem ✅
$ cat man-ls.md
# $ cat man-grep.md
# copy man docs, page by page
$ man grep
vscode
solution ✅use
vscode
to fix copy from the terminal encoding bug 🚀
.md
markdown file# export
$ man shutdown > shutdown.md
# $ man grep > grep.md
open exported .md
file with vscode
select all "
symbols, and press the backspace
/back delete
key twice (🔙
)
That's all.
gif
demo