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

Windows terminal: thin box characters appear as question marks #11

Closed
timgilbert opened this issue Nov 25, 2024 · 9 comments
Closed

Windows terminal: thin box characters appear as question marks #11

timgilbert opened this issue Nov 25, 2024 · 9 comments

Comments

@timgilbert
Copy link

Running the sample file via bb -Sdeps '{:deps {io.github.paintparty/bling {:mvn/version "0.4.2"}}}' -e "(require '[bling.sample]) (println (bling.sample/sample))" in Windows Terminal 1.21.32331.0, I see some extended characters rendered as question marks:

image
[...]
image

It looks like the thinner boxes from the demo are the ones affected. I don't know much about Windows character sets but am happy to test any fixes to this.

@paintparty
Copy link
Owner

Hi @timgilbert - thank you for reporting this and your willingness to test fixes.

Would you mind telling me the name of the font you are using with Windows Terminal? Or better yet try to zip the actual font file and attach it to a comment in this thread. I'm curious to see if I can replicate the question mark rendering on my side (mac).

Also, could you try using this font in Windows Terminal?
JetBrainsMono-2.304.zip

I'm wondering if those box drawing chars are outside the specific IBM PC / WGL4 subset that is mentioned here

If that is the case, the fix might be to use the slightly thinner versions of those (in the Bling lib) that would be in the subset.

@paintparty
Copy link
Owner

paintparty commented Nov 26, 2024

@timgilbert - also wondering if this setting specific to Windows Terminal mentioned here would help?

@timgilbert
Copy link
Author

Sorry for the delay! The font I'm using in Windows Terminal is Cascadia Mono, which is the default font. I've tried all the other ones in the "Appearance / Font face" preference and they all show question marks. I tried installing the JetBrains Mono fonts from the zip file above, but I still see the question marks when I set the terminal to use them.

I've tried toggling the "builtin glyphs" setting on and off, but it has no impact. (I tried with the JSON file as in the above link, then noticed there's just a Preferences / Appearance setting for it; neither had any effect.)

@timgilbert
Copy link
Author

I do see evidence that Windows Terminal supports these characters, eg microsoft/terminal#14654. Interestingly, when I copy and paste the box characters from github into my terminal, eg from this line, they show up just fine in the terminal:

image

I've also tried running this with clj instead of bb and got the same result, so it doesn't seem to be a babashka-specific thing.

@timgilbert timgilbert changed the title Windows terminal: some characters appear as question marks Windows terminal: thin box characters appear as question marks Dec 2, 2024
@timgilbert
Copy link
Author

I have noticed one odd discrepancy between clj and bb, though. The Clojure REPL prints box characters just fine, but bb prints them as question marks:

image

But running clj -Sdeps '{:deps {io.github.paintparty/bling {:mvn/version "0.4.2"}}}' -e "(require '[bling.sample]) (println (bling.sample/sample))" still prints the question marks.

@paintparty
Copy link
Owner

Thank you for taking the time to test this!

From a cursory glance at the slack thread the borkdude referenced, it seems unlikely that there is a bb-specific problem.

Just to clarify, do you get the question marks in Windows Terminal when you do the following from a repl in your terminal (requires clojure 1.12.0)? The bling samples should be printed after you call (bling.sample/sample):

➜  ~ clj

Clojure 1.12.0

user=> (add-libs '{io.github.paintparty/bling {:mvn/version "0.4.2"}})
[io.github.paintparty/bling]

user=> (require 'bling.sample)
nil

user=> (bling.sample/sample)

@paintparty
Copy link
Owner

Also, looking at this page, it says:

Windows Terminal is a modern host application for the command-line shells you already love, like Command Prompt, PowerShell, and bash (via Windows Subsystem for Linux (WSL)).

My knowledge of windows is limited, but I'm curious if Windows Terminal allows you to choose between using Command Prompt or PowerShell, and if that would be a factor in the box-drawing character rendering. It sounded like the user in the slack thread referenced above was using cmd.exe(Command Prompt), and they were not seeing Korean chars render properly.

@timgilbert
Copy link
Author

Hmm, well I'm not sure what I did, but I've suddenly got the proper characters to display in Clojure, but not babashka:

image

In case anyone comes across this in the future, the relevant bit from my settings.json is:

            {
                "guid": "{574e775e-4f2a-5b96-ac1e-a2962a402336}",
                "hidden": false,
                "name": "PowerShell",
                "showMarksOnScrollbar": true,
                "source": "Windows.Terminal.PowershellCore"
            },

Possibly a Clojure upgrade had something to do with this? In any event, bb still shows the question marks.

I tried the same sequence in cmd.exe and Windows PowerShell (v5.1.x, versus "regular" PowerShell which is 7.4.6) and the command shell had no effect.

Seems like the remaining bit of the problem is in some difference between how babashka and clj process extended characters on Windows, versus anything specific to bling. Thanks for your help! I think this ticket can be closed; I'll open a babashka ticket and link it here.

@paintparty
Copy link
Owner

Thank you @timgilbert

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

No branches or pull requests

2 participants