Skip to content

Do not render "current" char if no "current" char is configured#719

Merged
djc merged 2 commits intoconsole-rs:mainfrom
Finomnis:fix_cur_color_if_no_cur_char
Jul 7, 2025
Merged

Do not render "current" char if no "current" char is configured#719
djc merged 2 commits intoconsole-rs:mainfrom
Finomnis:fix_cur_color_if_no_cur_char

Conversation

@Finomnis
Copy link
Copy Markdown
Contributor

@Finomnis Finomnis commented Jul 6, 2025

Fixes #718.

Sample code:

use indicatif::{ProgressBar, ProgressStyle};

fn main() {
    let bar = ProgressBar::new(100)
        .with_style(ProgressStyle::with_template("{bar:10.red/blue}").unwrap());
    bar.inc(25);
    std::process::exit(0);
}

Result on main:
Image

Result after this change:
Image

Finomnis added 2 commits July 6, 2025 21:04
Prevents inconsistent coloring if fg/bg color is specified together with
two different fg/bg chars (like `"{bar:10.red/blue}"`)
@Finomnis Finomnis changed the title Fix color of "current" char if no "current" char is configured Do not render "current" char if no "current" char is configured Jul 6, 2025
Copy link
Copy Markdown
Member

@djc djc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to me, thanks!

@djc djc merged commit b3e94be into console-rs:main Jul 7, 2025
10 checks passed
@Finomnis Finomnis deleted the fix_cur_color_if_no_cur_char branch July 7, 2025 08:44
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

Successfully merging this pull request may close these issues.

Rendering in two colors causes inconsistent color of the cur character

2 participants