[GH-ISSUE #1068] Newlines a are lost (filtered out) when pasting into a textarea #773

Closed
opened 2026-03-04 01:07:38 +03:00 by kerem · 5 comments
Owner

Originally created by @svanharmelen on GitHub (Jan 6, 2025).
Original GitHub issue: https://github.com/rivo/tview/issues/1068

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!

Originally created by @svanharmelen on GitHub (Jan 6, 2025). Original GitHub issue: https://github.com/rivo/tview/issues/1068 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!
kerem closed this issue 2026-03-04 01:07:38 +03:00
Author
Owner

@svanharmelen commented on GitHub (Jan 29, 2025):

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

<!-- gh-comment-id:2622526399 --> @svanharmelen commented on GitHub (Jan 29, 2025): Is there any way to fix this with the current version of `tview`? Thanks!
Author
Owner

@rivo commented on GitHub (Mar 29, 2025):

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.

<!-- gh-comment-id:2763469429 --> @rivo commented on GitHub (Mar 29, 2025): I cannot reproduce this. Running the `demos/textarea/main.go` demo, I get this on iTerm2 (macOS): <img width="293" alt="Image" src="https://github.com/user-attachments/assets/60c57fb9-00c1-47ba-ad78-defa508d6b8f" /> 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.
Author
Owner

@svanharmelen commented on GitHub (Apr 15, 2025):

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
<!-- gh-comment-id:2804171444 --> @svanharmelen commented on GitHub (Apr 15, 2025): 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? <img width="792" alt="Image" src="https://github.com/user-attachments/assets/c32bc701-7643-4122-8102-b5b7826d25a0" />
Author
Owner

@rivo commented on GitHub (Aug 27, 2025):

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.

<!-- gh-comment-id:3229455888 --> @rivo commented on GitHub (Aug 27, 2025): 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.
Author
Owner

@laborin commented on GitHub (Mar 2, 2026):

Please see https://github.com/rivo/tview/pull/1147

<!-- gh-comment-id:3984426728 --> @laborin commented on GitHub (Mar 2, 2026): Please see https://github.com/rivo/tview/pull/1147
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/tview#773
No description provided.