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

[BUG] Cursive window borders contain gaps when viewed in Windows Terminal #709

Closed
riverar opened this issue Jan 10, 2023 · 6 comments
Closed
Labels

Comments

@riverar
Copy link

riverar commented Jan 10, 2023

Describe the bug

When displaying the example window in the Terminal app on Windows 11 (using the default font of Cascadia Mono), window borders contain a gap near the top-left and top-right corners. Screenshots have been provided below.

(If you need access to a Windows environment, let me know.)

Steps to reproduce

  1. Compile crate using files below.
  2. Launch Terminal app on Windows.
  3. Execute app.exe and observe results. (Screenshot provided above.)
  • Cargo.toml

    [package]
    name = "app"
    version = "0.0.0"
    edition = "2018"
    publish = false
    
    [dependencies.cursive]
    version = "0.20"
    default-features = false
    features = ["crossterm-backend"]
  • main.rs

    use cursive::views::{Dialog, TextView};
    
    fn main() {
        // Creates the cursive root - required for every application.
        let mut siv = cursive::default();
    
        // Creates a dialog with a single "Quit" button
        siv.add_layer(Dialog::around(TextView::new("Hello Dialog!"))
                             .title("Cursive")
                             .button("Quit", |s| s.quit()));
    
        // Starts the event loop.
        siv.run();
    }

Expected behavior

A clear and concise description of what you expected to happen.

Screenshots

  • Figure 1 - Example window showing gaps (Cascadia font family, default)

    image

  • Figure 2 - Attempt at reproducing the issue with a UTF-8 encoded text file containing drawing characters

    image

  • Figure 3 - Example window without gaps (Consolas font face)

    image

Environment

  • Tested on Windows 11 22000.739 (retail), 25272.1000 (insider)
  • crossterm backend
  • cursive 0.20
@riverar riverar added the bug label Jan 10, 2023
@riverar
Copy link
Author

riverar commented Jan 10, 2023

@DHowett for awareness, might be a Terminal bug?

  • Figure 4 - Example window in legacy Windows Console Host (Cascadia Mono font family, size 20)

    image

@riverar
Copy link
Author

riverar commented Jan 10, 2023

Windows Terminal using the experimental Atlas engine (1.16.3464.0) and same Cascadia Mono font family. No gap though blurry. Starting to look like this is a Windows Terminal issue, will file a bug there too.

image

@DHowett
Copy link

DHowett commented Jan 10, 2023

(We know about this one! Thanks!)

@gyscos
Copy link
Owner

gyscos commented Jan 10, 2023

Hi, and thanks for the report!

I do not have a windows environment at the moment, making testing this a bit tricky, but this does look like a rendering issue. Maybe the current font size leads to rounding issues after font hinting? 🤷

The surprising part is that printing a file with these characters appears to work.

Here are the characters printed by the dialog example (github doesn't render it well, but you can still copy/paste it):

┌──┤ Cursive ├──┐
│ Hello Dialog! │ 
│               │ 
│  <Foo> <Quit> │ 
└───────────────┘

You can try to update your hello.txt to have the exact same characters. Maybe the position of the text in the window can affect that too?

In any case it looks like the microsoft terminal team is aware of it :)

@riverar
Copy link
Author

riverar commented Jan 10, 2023

@gyscos Ah thanks for the text, that helps. The plot thickens...

image

(Do you want to close this issue and we keep the Terminal issue open?)

@riverar
Copy link
Author

riverar commented May 8, 2024

Fixed in latest Windows Terminal builds w/ Atlas Engine enabled. Closing this issue.

@riverar riverar closed this as completed May 8, 2024
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

3 participants