a-shell icon indicating copy to clipboard operation
a-shell copied to clipboard

Pasting to terminal strips out line breaks. Intended?

Open TFWol opened this issue 2 years ago • 2 comments

When I copy something like

echo foo
echo bar

I paste and end up with

echo fooecho bar

Is this a bug?

TFWol avatar Jan 27 '24 05:01 TFWol

Good question. After looking into the code, I can tell you it's a feature of hterm (the terminal emulation system we use: they replace all "\n" with "\r" and strip all control sequences). The command pbpaste does not do this translation.

I can see cases where this is useful, and cases where it is annoying. I need to think about it.

holzschu avatar Jan 27 '24 08:01 holzschu

Interesting. I thought I was missing something obvious. I believe it may be best to go with what's the most commonly expected.

My personal favorite is when a terminal pops up a screen showing what it's about to paste with bonus ability to edit it 😃 image

Thanks for looking into it.

TFWol avatar Jan 27 '24 18:01 TFWol