[GH-ISSUE #853] Scrambled text not found in old commit. #619

Closed
opened 2026-03-04 01:06:30 +03:00 by kerem · 9 comments
Owner

Originally created by @jorgeluismireles on GitHub (May 25, 2023).
Original GitHub issue: https://github.com/rivo/tview/issues/853

I found old code works correctly but newest doesn't, for the same example and machine I got:

For github.com/rivo/tview v0.0.0-20200915114512-42866ecf6ca6:
tview_old

For github.com/rivo/tview v0.0.0-20230525073430-4a1f85bb2219:
tview_new

For exactly the same example:

	app := tview.NewApplication()
	form := tview.NewForm().
		AddDropDown("Title", []string{"Mr.", "Ms.", "Mrs.", "Dr.", "Prof."}, 0, nil).
		AddInputField("First name", "", 20, nil, nil).
		AddInputField("Last name", "", 20, nil, nil).
		AddCheckbox("Age 18+", false, nil).
		AddPasswordField("Password", "", 10, '*', nil).
		AddButton("Save", nil).
		AddButton("Quit", func() {
			app.Stop()
		})
	form.SetBorder(true).SetTitle("Enter some data").SetTitleAlign(tview.AlignLeft)
	if err := app.SetRoot(form, true).EnableMouse(true).Run(); err != nil {
		panic(err)
	}
$ uname -a
Linux XXXXXX 4.4.0-210-generic #242-Ubuntu SMP Fri Apr 16 09:57:00 UTC 2021 i686 i686 i686 GNU/Linux

I searched the FAQ, tried several console's configs changes but the issue persists.
Thanks for your advice!

Originally created by @jorgeluismireles on GitHub (May 25, 2023). Original GitHub issue: https://github.com/rivo/tview/issues/853 I found old code works correctly but newest doesn't, for the same example and machine I got: For github.com/rivo/tview v0.0.0-20200915114512-42866ecf6ca6: ![tview_old](https://github.com/rivo/tview/assets/3935834/1e937a1d-5b36-44c0-b6a0-438479efa69d) For github.com/rivo/tview v0.0.0-20230525073430-4a1f85bb2219: ![tview_new](https://github.com/rivo/tview/assets/3935834/93e80c3d-9ac5-434e-9a3f-bf31d6b449fe) For exactly the same example: ``` app := tview.NewApplication() form := tview.NewForm(). AddDropDown("Title", []string{"Mr.", "Ms.", "Mrs.", "Dr.", "Prof."}, 0, nil). AddInputField("First name", "", 20, nil, nil). AddInputField("Last name", "", 20, nil, nil). AddCheckbox("Age 18+", false, nil). AddPasswordField("Password", "", 10, '*', nil). AddButton("Save", nil). AddButton("Quit", func() { app.Stop() }) form.SetBorder(true).SetTitle("Enter some data").SetTitleAlign(tview.AlignLeft) if err := app.SetRoot(form, true).EnableMouse(true).Run(); err != nil { panic(err) } ``` ``` $ uname -a Linux XXXXXX 4.4.0-210-generic #242-Ubuntu SMP Fri Apr 16 09:57:00 UTC 2021 i686 i686 i686 GNU/Linux ``` I searched the FAQ, tried several console's configs changes but the issue persists. Thanks for your advice!
kerem closed this issue 2026-03-04 01:06:30 +03:00
Author
Owner

@jorgeluismireles commented on GitHub (May 25, 2023):

The problem is present even for base example of recent tcell:

github.com/gdamore/tcell/v2 v2.6.0

But my systems (ARM32, x86) works OK with old tview mentioned which uses 'old' tcell:

github.com/gdamore/tcell v1.3.0 // indirect

How to proceed?

More details about the differences from tcell requires:
Old versions that work for my case:

require (
	github.com/lucasb-eyer/go-colorful v1.0.3 // indirect
	github.com/mattn/go-runewidth v0.0.9 // indirect
	github.com/rivo/uniseg v0.1.0 // indirect
)

New versions don't:

require (
	github.com/lucasb-eyer/go-colorful v1.2.0 // indirect
	github.com/mattn/go-runewidth v0.0.14 // indirect
	github.com/rivo/uniseg v0.4.3 // indirect
)
<!-- gh-comment-id:1563401284 --> @jorgeluismireles commented on GitHub (May 25, 2023): The problem is present even for base example of recent tcell: ``` github.com/gdamore/tcell/v2 v2.6.0 ``` But my systems (ARM32, x86) works OK with old tview mentioned which uses 'old' tcell: ``` github.com/gdamore/tcell v1.3.0 // indirect ``` How to proceed? More details about the differences from tcell requires: Old versions that work for my case: ``` require ( github.com/lucasb-eyer/go-colorful v1.0.3 // indirect github.com/mattn/go-runewidth v0.0.9 // indirect github.com/rivo/uniseg v0.1.0 // indirect ) ``` New versions don't: ``` require ( github.com/lucasb-eyer/go-colorful v1.2.0 // indirect github.com/mattn/go-runewidth v0.0.14 // indirect github.com/rivo/uniseg v0.4.3 // indirect ) ```
Author
Owner

@rivo commented on GitHub (May 25, 2023):

I would suggest that you take this issue over to tcell. tview is based on tcell. If tcell has this problem, tview will have it, too, and it needs to be solved there. In that case, there's nothing I can do here.

<!-- gh-comment-id:1563447817 --> @rivo commented on GitHub (May 25, 2023): I would suggest that you take this issue over to [`tcell`](https://github.com/gdamore/tcell). `tview` is based on `tcell`. If `tcell` has this problem, `tview` will have it, too, and it needs to be solved there. In that case, there's nothing I can do here.
Author
Owner

@jorgeluismireles commented on GitHub (May 25, 2023):

Thanks. The problem started when tcell changed from v1.4.0 to v2

The last version "working" is the v2.5.1, the first "failing" is v2.5.2. I'll post the issue there.

<!-- gh-comment-id:1563524671 --> @jorgeluismireles commented on GitHub (May 25, 2023): Thanks. The problem started when ```tcell``` changed from v1.4.0 to v2 The last version "working" is the v2.5.1, the first "failing" is v2.5.2. I'll post the issue [there](https://github.com/gdamore/tcell/issues/616).
Author
Owner

@gdamore commented on GitHub (May 26, 2023):

I'm guessing some terminal is missing support for some capabilities that I'm using... I need more detail about the specific terminal so I can investigate.

<!-- gh-comment-id:1563655959 --> @gdamore commented on GitHub (May 26, 2023): I'm guessing some terminal is missing support for some capabilities that I'm using... I need more detail about the specific terminal so I can investigate.
Author
Owner

@jorgeluismireles commented on GitHub (May 26, 2023):

Workaround

For legacy linux 32 bits systems arm, x86 set environment variable TERM=linux before to prevent latest versions scramble the display. Default terminals of type xterm cause escape/mouse artifacts.

<!-- gh-comment-id:1564810692 --> @jorgeluismireles commented on GitHub (May 26, 2023): ### Workaround For legacy linux 32 bits systems ```arm```, ```x86``` set environment variable ```TERM=linux``` before to prevent latest versions scramble the display. Default terminals of type ```xterm``` cause escape/mouse artifacts.
Author
Owner

@gdamore commented on GitHub (May 26, 2023):

If this is on a linux terminal then any form of "xterm" is wrong because it does not support the normal xterm escapes.

<!-- gh-comment-id:1564813932 --> @gdamore commented on GitHub (May 26, 2023): If this is on a linux terminal then any form of "xterm" is wrong because it does not support the normal xterm escapes.
Author
Owner

@rivo commented on GitHub (Jun 18, 2023):

@jorgeluismireles Have you been able to solve this? I will probably close this issue soon as it doesn't appear to be related to tview.

<!-- gh-comment-id:1596101069 --> @rivo commented on GitHub (Jun 18, 2023): @jorgeluismireles Have you been able to solve this? I will probably close this issue soon as it doesn't appear to be related to `tview`.
Author
Owner

@gdamore commented on GitHub (Jun 18, 2023):

I'm quite certain that the problem here is neither a bug in tcell nor tview. It was user error declaring a terminal to be xterm that isn't, which caused us to emit various escape sequences that the terminal did not know how to handle.

I recommend just closing this as not a bug.

And for posterity: The linux console is not xterm. It is "linux", and I believe that is the correct setting for $TERM when using the linux console.

<!-- gh-comment-id:1596109327 --> @gdamore commented on GitHub (Jun 18, 2023): I'm quite certain that the problem here is neither a bug in tcell nor tview. It was user error declaring a terminal to be xterm that isn't, which caused us to emit various escape sequences that the terminal did not know how to handle. I recommend just closing this as not a bug. And for posterity: The linux console is *not* xterm. It is "linux", and I believe that is the correct setting for $TERM when using the linux console.
Author
Owner

@jorgeluismireles commented on GitHub (Jun 19, 2023):

Yes, I solved the problem setting in old linux terminals: TERM=linux. Thanks!

<!-- gh-comment-id:1597461041 --> @jorgeluismireles commented on GitHub (Jun 19, 2023): Yes, I solved the problem setting in **old** linux terminals: `TERM=linux`. Thanks!
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#619
No description provided.