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

Visual bugs in cmd with stray underlines #4431

Closed
2 tasks done
thatbakamono opened this issue Oct 30, 2022 · 3 comments · Fixed by #4767
Closed
2 tasks done

Visual bugs in cmd with stray underlines #4431

thatbakamono opened this issue Oct 30, 2022 · 3 comments · Fixed by #4767
Labels
A-help Area: documentation, including docs.rs, readme, examples, etc... C-bug Category: Updating dependencies S-blocked Status: Blocked on something else such as an RFC or other implementation work.
Milestone

Comments

@thatbakamono
Copy link

thatbakamono commented Oct 30, 2022

Please complete the following tasks

Rust Version

rustc 1.65.0-nightly (f03ce3096 2022-08-08)

Clap Version

4.0.18

Minimal reproducible code

use clap::Command;

fn main() {
    Command::new("repro").get_matches();
}

Steps to reproduce the bug with the above code

cargo run -- --help

Actual Behaviour

image

Expected Behaviour

image

Additional Context

The first screenshot shows cmd, the second screenshot shows windows terminal. I wasn't able to trigger this bug in windows terminal but it's worth noting that even in cmd, it doesn't always happen:
image

Debug Output

No response

@thatbakamono thatbakamono added the C-bug Category: Updating dependencies label Oct 30, 2022
@epage
Copy link
Member

epage commented Nov 5, 2022

Tbat most likely means something is going wrong with termcolor's wincon support as that is most likely the main difference between the two terminals. Whats especially weird is that there is no reason to put an underline after "information" as we only use underline in headers and so we aren't touching it at that point.

If you want to go an extra step, reproducing this in termcolor and creating an upstream issue would be great. With #1433, we will most likely be moving off of termcolor though, so we'll need to keep in mind to fix this when we do.

@epage epage added this to the 4.x milestone Nov 5, 2022
@epage epage added A-help Area: documentation, including docs.rs, readme, examples, etc... S-blocked Status: Blocked on something else such as an RFC or other implementation work. labels Nov 5, 2022
@saffaffi
Copy link

saffaffi commented Dec 9, 2022

I'm seeing this happen in Wezterm, but specifically only when the help text is printed when the output in the terminal window has reached the bottom. It happens under that condition with both TERM=wezterm and TERM=xterm-256color.

@epage epage changed the title Visual bugs in cmd Visual bugs in cmd with stray underlines Dec 26, 2022
@YamatoSecurity
Copy link

We also have the same problem when running on Windows 10 Command Prompt or Powershell Prompt.
(It does not have this bug in Windows 11)
Rust: 1.67.1
Clap: 4.1.6

At first it looks like this:
clap-line-1

If I resize the window, the line will extend out from the Options group name:
clap-line-2

epage added a commit to epage/clap that referenced this issue Mar 17, 2023
Windows will style all blank space until the end of line (sometimes).

Fixes clap-rs#4431
epage added a commit to epage/clap that referenced this issue Mar 17, 2023
Windows will style all blank space until the end of line (sometimes).

Fixes clap-rs#4431
epage added a commit to epage/clap that referenced this issue Mar 17, 2023
Windows will style all blank space until the end of line (sometimes).

Fixes clap-rs#4431
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-help Area: documentation, including docs.rs, readme, examples, etc... C-bug Category: Updating dependencies S-blocked Status: Blocked on something else such as an RFC or other implementation work.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants