Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cjk text refresh residue #644

Closed
hxse opened this issue Jun 4, 2021 · 12 comments
Closed

cjk text refresh residue #644

hxse opened this issue Jun 4, 2021 · 12 comments
Labels

Comments

@hxse
Copy link

hxse commented Jun 4, 2021

dir 1:
image

dir 2:
image

dir 2 to dir1:
image

When switching from the dir 2 to the dir 1, the english text refresh normal, but the cjk text residue.

@gokcehan
Copy link
Owner

gokcehan commented Jun 6, 2021

@hxse Thanks for reporting. Is this specific to windows terminal or you can reproduce it on different terminals as well? This may likely be terminal or a tcell issue. Also can you copy the names of those files here as text so maybe we can try reproducing?

@gokcehan gokcehan added the bug label Jun 6, 2021
@hxse
Copy link
Author

hxse commented Jun 6, 2021

@gokcehan I only know that Windows is like this because I only have Windows.
On windows: "windows terminal", "cmd.exe", "Windows PowerShell", they all have this bug
Test cjk str:
新建文件
新建文本文档
文件文件夹
测试文档

@mshungo
Copy link

mshungo commented Jul 27, 2021

I had a similar problem with Japanese fonts. When LF displays the Japanese file, the rendering was weird and finally the console crashed. However, when I turned on "legacy console" in the command prompt options, it rendered fine.

Unfortunately I no longer get to choose my favorite font in legacy console(probably can be changed in regedit), but for the moment it works fine.

@gokcehan
Copy link
Owner

@mshungo Thanks for the workaround. It's unfortunate that I don't know how to solve some of these terminal issues. I have now created a Troubleshoot wiki page so such workarounds would not be buried in the issues. I have tried adding this to the page. Feel free to add more information there if you like.

@zcysxy
Copy link

zcysxy commented Aug 24, 2021

Emmm this is a really annoying bug. Is there any way to prevent the preview of CJK? by configuring the previewer or something.

@gokcehan
Copy link
Owner

@zcysxy That might be possible if there's a way to tell if a file has CJK characters from within the script set for previewer.

@SpicyChickenFLY
Copy link

Hi, @hxse, I found that you have closed this issue. Is there any idea for a solution for this?

@gokcehan
Copy link
Owner

gokcehan commented Mar 3, 2022

We can reopen this issue to track it but I don't think there is much we can do about this on our side. From what I understand from discussions, I suspect this is a tcell issue as it uses a different API for unix and windows. I found junegunn/fzf#2715 reported in fzf repository which might be related to this issue. Unfortunately, I haven't found anything related reported in tcell repository. If anyone wants to see this issue fixed, it might be a good idea to reproduce this issue with a toy example for tcell and report the bug. If the issue is solved, we can simply bump our tcell version in lf to include the fix on our side.

@SpicyChickenFLY
Copy link

@gokcehan yeah, I agree with you, and I found a related issue in microsoft/terminal#12479 and it is now assigned to a contributor of that repo. Maybe we will get a conclusion soon XD.

@ayuayue
Copy link

ayuayue commented Feb 4, 2023

you can reset key l && h,and use reload command;
I use powershell in windows11. and now it's very nice.
eg:

# lfrc

map l 
map h

map l :open; reload
map h :updir; reload

@ayuayue
Copy link

ayuayue commented Feb 4, 2023

and set j,k to redraw

# lfrc
map k
map j

map k :up; redraw
map j :down; redraw

@CAESIUS-TIM
Copy link

CAESIUS-TIM commented Oct 9, 2023

and set j,k to redraw

# lfrc
map k
map j

map k :up; redraw
map j :down; redraw

In WindowsTerminal with pwsh7, without these maps, chinese characters can be rendered sometimes (every movement has a chance to (dis)appear chars, weirdly), and even cannot highlight text preview properly.
After setting, chinese characters completely disappear 💀.
I have given up WindowsTerminal. Instead, WindTerm can render chinese chars (but sometimes misses the first char) and true color.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants