(I am using the kitty terminal emulator, though I would appreciate answers for other terminal emulators as well.)
I run a command, and get some error message, like this:
~ » somecommand
❌️ Some Error Message # from stderr
Obviously, to copy the stderr of the command, I can do somecommand 2>&1 >/dev/null | wl-copy (or xclip)
But I usually forget to do that, and I don't want to re-run the command, and I never remember the syntax for piping stderr so I have to context-switch anyway to look it up.
Is there a simple command I can alias in my .zshrc, or a keyboard shortcut I can configure, to copy the stderr of the previous run command in the terminal emulator?