tview icon indicating copy to clipboard operation
tview copied to clipboard

Newlines a are lost (filtered out) when pasting into a textarea

Open svanharmelen opened this issue 1 year ago • 3 comments

I am using the suggested Application.EnablePaste, and while it does speed up and improve pasting in general, it doesn't fix the issue the newlines appear to be filtered out when pasting. So if I paste a block of text which consists of several lines, I end up with a single line. Is there an option or setting that I need to configure for it to paste the text as is?

Example:

Hello
how
are
you
doing?

When copy/pasted end up like this:

Hellohowareyoudoing?

Thanks!

svanharmelen avatar Jan 06 '25 22:01 svanharmelen

Is there any way to fix this with the current version of tview? Thanks!

svanharmelen avatar Jan 29 '25 18:01 svanharmelen

I cannot reproduce this. Running the demos/textarea/main.go demo, I get this on iTerm2 (macOS):

Image

And this is both with EnablePaste set to true or false.

Seems to me that this is rather a terminal application / OS issue than a tview issue.

rivo avatar Mar 29 '25 15:03 rivo

Interesting... I'm using both Alacritty and Ghostty and both give the same issue. Yet trying the native Terminal app on macOS it indeed seems to work. Any idea what features or setting this could relate to so I can investigate further?

Image

svanharmelen avatar Apr 15 '25 07:04 svanharmelen

Unfortunately, I'm not familiar with either of these terminals. I'd look into the settings. Maybe there's an option to control how text gets pasted. I'd also check if the same issue exists with other programs running inside these terminals.

Will close this for now because it seems that this is not a tview issue. Feel to open a new issue if needed or if new information becomes available.

rivo avatar Aug 27 '25 19:08 rivo