tmux on Cygwin displays broken separators #18735

Closed
opened 2026-01-31 06:22:50 +00:00 by claunia · 10 comments
Owner

Originally created by @carlescufi on GitHub (Oct 21, 2022).

Windows Terminal version

1.15.2875.0

Windows build number

10.0.22621.675

Other Software

Cygwin 3.3.6-1
tmux 3.2a

Steps to reproduce

  1. Open a new tab with a Cygwin profile.
  2. ssh into an Ubuntu virtual machine
  3. Run tmux new -s mysession

Expected Behavior

Separator bars are displayed correctly

Actual Behavior

image

Originally created by @carlescufi on GitHub (Oct 21, 2022). ### Windows Terminal version 1.15.2875.0 ### Windows build number 10.0.22621.675 ### Other Software Cygwin 3.3.6-1 tmux 3.2a ### Steps to reproduce 1. Open a new tab with a Cygwin profile. 2. ssh into an Ubuntu virtual machine 3. Run `tmux new -s mysession` ### Expected Behavior Separator bars are displayed correctly ### Actual Behavior ![image](https://user-images.githubusercontent.com/12450381/197179941-8115a1b5-aee2-45a8-aa99-8b4ce6f295da.png)
claunia added the Issue-QuestionNeeds-Tag-FixResolution-Answered labels 2026-01-31 06:22:51 +00:00
Author
Owner

@lhecker commented on GitHub (Oct 21, 2022):

Which font family and size are you using? Did you configure any font axes or features?
It's likely that this issue won't reproduce in Windows Terminal Preview as it defaults to another text renderer (which unfortunately has its own set of issues I'm currently working on).

@lhecker commented on GitHub (Oct 21, 2022): Which font family and size are you using? Did you configure any font axes or features? It's likely that this issue won't reproduce in Windows Terminal Preview as it defaults to another text renderer (which unfortunately has its own set of issues I'm currently working on).
Author
Owner

@carlescufi commented on GitHub (Oct 24, 2022):

I am using CodeNewRoman NF from NERDFonts.:
https://www.nerdfonts.com/font-downloads

@carlescufi commented on GitHub (Oct 24, 2022): I am using `CodeNewRoman NF` from NERDFonts.: https://www.nerdfonts.com/font-downloads
Author
Owner

@lhecker commented on GitHub (Oct 24, 2022):

That font isn't monospace:
image

You have to use CodeNewRoman NFM instead. The .zip contains files that include "Mono" in the name, which can then be used with the NFM suffix (with M being short for Monospace).

@lhecker commented on GitHub (Oct 24, 2022): That font isn't monospace: ![image](https://user-images.githubusercontent.com/2256941/197536168-ca4e93a8-335b-48ae-a186-d120c05f2bd1.png) You have to use `CodeNewRoman NFM` instead. The .zip contains files that include "Mono" in the name, which can then be used with the `NFM` suffix (with M being short for Monospace).
Author
Owner

@carlescufi commented on GitHub (Oct 24, 2022):

That font isn't monospace: image

You have to use CodeNewRoman NFM instead. The .zip contains files that include "Mono" in the name, which can then be used with the NFM suffix.

Although you are theoretically correct, in practice CodeNewRoman NF is monospace indeed, just tested this:
image

Anyway I switched to NFM and changed nothing, the separator is still broken. Let me know if you'd like me to try another font.

@carlescufi commented on GitHub (Oct 24, 2022): > That font isn't monospace: ![image](https://user-images.githubusercontent.com/2256941/197536168-ca4e93a8-335b-48ae-a186-d120c05f2bd1.png) > > You have to use `CodeNewRoman NFM` instead. The .zip contains files that include "Mono" in the name, which can then be used with the `NFM` suffix. Although you are theoretically correct, in practice `CodeNewRoman NF` is monospace indeed, just tested this: ![image](https://user-images.githubusercontent.com/12450381/197538707-39c5c71e-cce6-4b7a-941d-75808afed198.png) Anyway I switched to `NFM` and changed nothing, the separator is still broken. Let me know if you'd like me to try another font.
Author
Owner

@carlescufi commented on GitHub (Oct 24, 2022):

Actually, scratch that. You are right, my mistake. I got confused by the way mintty handles this, which I was using as a reference.

@carlescufi commented on GitHub (Oct 24, 2022): Actually, scratch that. You are right, my mistake. I got confused by the way mintty handles this, which I was using as a reference.
Author
Owner

@carlescufi commented on GitHub (Oct 24, 2022):

@lhecker first, thanks for correcting my mistake. Second, I wonder if you know why Windows Terminal shows the NF font differently than something like mintty, which shows it identical to NFM. Thanks in advance!

@carlescufi commented on GitHub (Oct 24, 2022): @lhecker first, thanks for correcting my mistake. Second, I wonder if you know why Windows Terminal shows the `NF` font differently than something like mintty, which shows it identical to `NFM`. Thanks in advance!
Author
Owner

@lhecker commented on GitHub (Oct 24, 2022):

From what I can tell, mintty places glyphs in a monospace grid no matter what font is used. Basically, it discards the font's "glyph advance" (the "width" of a glyph) to make them fit into the grid. Windows Terminal's renderer on the other hand uses the font information wherever possible. This is the code in mintty that's responsible for the behavior: cbaa7665c8/src/wintext.c (L3108-L3118)

I have a branch where I'm doing the exact same thing as mintty, but I unfortunately haven't completed that work yet. Once we merge that, Windows Terminal will work with any arbitrary font (include script fonts, like Segoe Script).

@lhecker commented on GitHub (Oct 24, 2022): From what I can tell, mintty places glyphs in a monospace grid no matter what font is used. Basically, it discards the font's "glyph advance" (the "width" of a glyph) to make them fit into the grid. Windows Terminal's renderer on the other hand uses the font information wherever possible. This is the code in mintty that's responsible for the behavior: https://github.com/mintty/mintty/blob/cbaa7665c82accc91a395414be121f2a435a6e03/src/wintext.c#L3108-L3118 I have a branch where I'm doing the exact same thing as mintty, but I unfortunately haven't completed that work yet. Once we merge that, Windows Terminal will work with any arbitrary font (include script fonts, like Segoe Script).
Author
Owner

@carlescufi commented on GitHub (Oct 24, 2022):

@lhecker thanks very much for the insight. I just checked and Terminal.app and it seems to behave just like mintty.

I have a branch where I'm doing the exact same thing as mintty

So this behavior is the future of Windows Terminal?

@carlescufi commented on GitHub (Oct 24, 2022): @lhecker thanks very much for the insight. I just checked and `Terminal.app` and it seems to behave just like mintty. > I have a branch where I'm doing the exact same thing as mintty So this behavior is the future of Windows Terminal?
Author
Owner

@lhecker commented on GitHub (Oct 24, 2022):

Yeah I'd say so. However I don't intend to do it to make proportional/non-monospace fonts like CodeNewRoman NF work and I don't think that's why mintty/Terminal.app/... do it either.
I believe this is more like a result of trying to make complex Unicode work better in terminals, because fallback fonts that contain such Unicode are usually never monospace. For instance a single emoji can mess up your layout in VS Code:
image

While this can be tolerated in a text editor, a terminal needs to be stricter in my opinion. And that's why I'm sure that this is the future of Windows Terminal as well. The strict monospace layout already works in the new "AtlasEngine" text renderer that you can try out in Windows Terminal Preview. But I'm now working on combining the benefits of the old and new text renderers to allow arbitrary overlapping fonts (like cursive script fonts) with strict monospace. I'm hoping to finish this new text renderer within this year.

@lhecker commented on GitHub (Oct 24, 2022): Yeah I'd say so. However I don't intend to do it to make proportional/non-monospace fonts like `CodeNewRoman NF` work and I don't think that's why mintty/Terminal.app/... do it either. I believe this is more like a result of trying to make complex Unicode work better in terminals, because fallback fonts that contain such Unicode are usually never monospace. For instance a single emoji can mess up your layout in VS Code: ![image](https://user-images.githubusercontent.com/2256941/197549732-2cd409b7-eed4-43d8-8c78-6eaf4d0dff0b.png) While this can be tolerated in a text editor, a terminal needs to be stricter in my opinion. And that's why I'm sure that this is the future of Windows Terminal as well. The strict monospace layout already works in the new "AtlasEngine" text renderer that you can try out in Windows Terminal Preview. But I'm now working on combining the benefits of the old and new text renderers to allow arbitrary overlapping fonts (like cursive script fonts) with strict monospace. I'm hoping to finish this new text renderer within this year.
Author
Owner

@carlescufi commented on GitHub (Oct 24, 2022):

@lhecker thank you again for the lengthy explanation.

@carlescufi commented on GitHub (Oct 24, 2022): @lhecker thank you again for the lengthy explanation.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#18735