wagoodman / dive

A tool for exploring each layer in a docker image
MIT License
46.64k stars 1.77k forks source link

Terminal prints broken on macOS with ko_KR locale #474

Open sinoru opened 1 year ago

sinoru commented 1 year ago

What happened:

➜  ~ export LANG=ko_KR.UTF-8
➜  ~ dive debian:latest
image

What you expected to happen:

➜  ~ export LANG=en_US.UTF-8
➜  ~ dive debian:latest
image

How to reproduce it (as minimally and precisely as possible):

export LANG=ko_KR.UTF-8

Anything else we need to know?:

Environment:

eye942 commented 10 months ago

Looks like the issue could be with fillStr and selectedFillStr

It sounds as if your terminal font might have a different Korean/CJK rendering for both box drawings horizontal light and em-dash between the locales.

What is your Terminal font and character set?

sinoru commented 10 months ago

What is your Terminal font and character set?

I'm using SF mono on iTerm2, It's character set is probably UTF-8.

eye942 commented 10 months ago

Looks iTerm2 has an faq entry that might solve this:

Q: The fonts are looking weird. What should I do? A: iTerm2 lets you to specify two fonts. If you only use English or western european languages, you probably only need to set the font for ASCII characters. For other languages, you need to specify a font that works with your language as the Non-ASCII font. You need to make sure the size (height) of two fonts do not differ greatly, so iTerm2 won't display a mess of mixed glyphs.

Q: Some characters appear to be twice as wide as others, and things aren't lining up correctly. Q: I'm a Chinese, Japanese, or Korean user and some characters don't line up because they are not rendered in double-width. A: Go to Preferences > Profiles > Text and change the setting of "Treat ambiguous-width characters as double-width."