# Remove unwanted new lines when copy-pasting from a narrow Terminal pane

Published: 2026-03-16T00:00:00.000Z
Canonical: https://wow.pjh.is/journal/fix-terminal-copy-paste

Hopefully, your work sessions often look like this:

![Codex and Claude](https://wow.pjh.is/static/images/blog/codex-and-claude.jpeg)

But with lots of narrow panes, text wraps. And then, when you copy-paste a URL, you end up with something like this:

```
https://wow.pjh.is/journal/google-cloud-
  console-setup-for-cli-tools
```

The line was wrapped to fit the pane width, and clipboard preserved the newline. Broken link. 🤦

Same thing happens with commands.

## The fix

A [script](https://github.com/HartreeWorks/scripts--clipboard-unwrap-from-terminal) that:

1. Monitors the clipboard when Warp, Terminal, or iTerm2 is frontmost.
2. Detects soft-wrapped text, and silently rejoins it.
