mirror of
https://github.com/rivo/tview.git
synced 2026-04-26 21:35:54 +03:00
[GH-ISSUE #862] Bug in list creation when using Chinese parameter for AddItem #626
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/tview#626
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @nohunt on GitHub (Jul 7, 2023).
Original GitHub issue: https://github.com/rivo/tview/issues/862
OS: Windows 11
Description:
I modified the list demo in the demos directory by changing the parameter of AddItem from English to Chinese. Here's the modified code:
After compiling and running the code, the following issue occurs: when selecting a Chinese item and pressing the Enter key, the content disappears, and the arrow keys also don't work properly. The same behavior happens when using the up and down arrow keys.
@nohunt commented on GitHub (Jul 7, 2023):
Apologies, I found a solution to the issue in someone else's reported problem. I added the following code snippet, as mentioned below. However, I'm unsure about the underlying reason for its effectiveness
@rivo commented on GitHub (Jul 7, 2023):
Isn't this an issue with the Windows terminal? I thought that it cannot display Unicode characters properly. On macOS iTerm 2, it looks like this:
@nohunt commented on GitHub (Jul 10, 2023):
I'm not entirely sure if it's an issue with Windows terminal, but after modifying the code, it appears to have resolved the problem. Here's the updated code
@yumao233 commented on GitHub (Jul 23, 2023):
Great, it works.
I also encountered the same problem.
Although I think this should be a
BUG, but at least there is a solution.Here comes a short video explaining the bug:
https://github.com/rivo/tview/issues/864
@xyaman commented on GitHub (Mar 18, 2024):
I have exactly the same problem when using wezterm on Windows 11. Using
App.Sync()works, but with every event, it blinks, so it's not ideal.Bug:
https://github.com/rivo/tview/assets/32078353/945c7a4f-9c36-4a0d-9b8c-0a89dc54e38b
With
App.Sync()https://github.com/rivo/tview/assets/32078353/22d5b35d-9e50-4477-bf11-154921618bc2
@rivo commented on GitHub (Apr 3, 2024):
I ran the code from above (the original comment, without the
app.Sync()command) on Windows 11 with no problems. No flickering, no disappearing characters after pressing Enter or otherwise. Here is a screenshot:The flickering on Windows has been resolved a few weeks ago. (Not sure if this was the original problem but I cannot reproduce it as of now.)
I don't have wezterm so I don't know how compatible it is with
tcell. It seems to me that this is rather a problem with your terminal's configuration.In general, I should mention that
tviewdoes not deal with terminal configurations or escape characters directly. This all happens on thetcelllayer. I would suggest that you create a small program usingtcell(not using anytviewcomponents, to avoid confusion) which reproduces this and then open an issue there: https://github.com/gdamore/tcell.So I will close this issue now as I don't see anything that can be solved in this project.