[GH-ISSUE #1138] freeze caused by pasting text into TextArea #825

Open
opened 2026-03-04 01:07:59 +03:00 by kerem · 0 comments
Owner

Originally created by @GrailFinder on GitHub (Dec 14, 2025).
Original GitHub issue: https://github.com/rivo/tview/issues/1138

hello;
is there some sort of limit in tcell or tview on pasting length|size?
could it be increased?

I found clear boundary, where 15 lines of following text (including \n) are could be pasted without issues
while 16 lines are causing freeze.
tested on multiple terminals, on two machines (st, xterm, ghostty, wezterm);

If you can keep your head when all about you   
    Are losing theirs and blaming it on you,   
If you can trust yourself when all men doubt you,
    But make allowance for their doubting too;   

If you can wait and not be tired by waiting,
    Or being lied about, don’t deal in lies,
Or being hated, don’t give way to hating,
    And yet don’t look too good, nor talk too wise:

If you can dream—and not make dreams your master;   
    If you can think—and not make thoughts your aim;   
If you can meet with Triumph and Disaster
    And treat those two impostors just the same;   

If you can bear to hear the truth you’ve spoken
    Twisted by knaves to make a trap for fools,

minimal example to reproduce

package main

import (
	"github.com/gdamore/tcell/v2"
	"github.com/rivo/tview"
)

func main() {
	app := tview.NewApplication()
	// Create text area
	textArea := tview.NewTextArea().
		SetPlaceholder("input is multiline; press <Enter> to start the next line;\npress <Esc> to exit.")
	textArea.SetBorder(true).SetTitle("input")
	textArea.SetWrap(false)
	// Set up input capture for Ctrl+C and Escape to exit
	app.SetInputCapture(func(event *tcell.EventKey) *tcell.EventKey {
		if event.Key() == tcell.KeyEscape || event.Key() == tcell.KeyCtrlC {
			app.Stop()
		}
		return event
	})
	// Enable paste
	if err := app.SetRoot(textArea, true).EnableMouse(true).EnablePaste(true).Run(); err != nil {
		panic(err)
	}
}
Originally created by @GrailFinder on GitHub (Dec 14, 2025). Original GitHub issue: https://github.com/rivo/tview/issues/1138 hello; is there some sort of limit in tcell or tview on pasting length|size? could it be increased? I found clear boundary, where 15 lines of following text (including \n) are could be pasted without issues while 16 lines are causing freeze. tested on multiple terminals, on two machines (st, xterm, ghostty, wezterm); ``` If you can keep your head when all about you Are losing theirs and blaming it on you, If you can trust yourself when all men doubt you, But make allowance for their doubting too; If you can wait and not be tired by waiting, Or being lied about, don’t deal in lies, Or being hated, don’t give way to hating, And yet don’t look too good, nor talk too wise: If you can dream—and not make dreams your master; If you can think—and not make thoughts your aim; If you can meet with Triumph and Disaster And treat those two impostors just the same; If you can bear to hear the truth you’ve spoken Twisted by knaves to make a trap for fools, ``` minimal example to reproduce ``` package main import ( "github.com/gdamore/tcell/v2" "github.com/rivo/tview" ) func main() { app := tview.NewApplication() // Create text area textArea := tview.NewTextArea(). SetPlaceholder("input is multiline; press <Enter> to start the next line;\npress <Esc> to exit.") textArea.SetBorder(true).SetTitle("input") textArea.SetWrap(false) // Set up input capture for Ctrl+C and Escape to exit app.SetInputCapture(func(event *tcell.EventKey) *tcell.EventKey { if event.Key() == tcell.KeyEscape || event.Key() == tcell.KeyCtrlC { app.Stop() } return event }) // Enable paste if err := app.SetRoot(textArea, true).EnableMouse(true).EnablePaste(true).Run(); err != nil { panic(err) } } ```
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#825
No description provided.