Building an intelligent copy button that extracts only the commands from shell snippets, handling prompts, continuations, heredocs, and output.