Skip to content
This repository has been archived by the owner on Feb 16, 2024. It is now read-only.

Coloring errors #41

Closed
Razican opened this issue Sep 29, 2016 · 8 comments
Closed

Coloring errors #41

Razican opened this issue Sep 29, 2016 · 8 comments

Comments

@Razican
Copy link
Member

Razican commented Sep 29, 2016

We currently have some coloring errors in the console, this should be fixed for the next version (or hopefully, if it's really easy to fix, for 0.1.0.

An example:
screenshot

@pocket7878
Copy link
Contributor

Is there any minimum example to reproduce this error?

@Br1oP
Copy link
Member

Br1oP commented Oct 13, 2016

Hello, @pocket7878. I just made a simple example to reproduce the error. This is the code:

extern crate colored;

use colored::*;

fn main() {
    let world = "world".bold();
    let hello_world = format!("Hello, {}!", world);
    println!("{}", hello_world);
    let hello_world = format!("Hello, {}!lalalala", world).red();
    println!("{}", hello_world);
}

These are the results:

error

As you see, when you mix bold + colour, the colouring is not working correctly. It should colour the whole sentence but it stops at the exclamation mark.

@Razican
Copy link
Member Author

Razican commented Oct 13, 2016

I reported the issue in upstream.

It might be solved using termion (tutorial), since it seems an upstream issue. If not, we might need to modify our printing system, maybe creating our own printing library.

@mackwic
Copy link

mackwic commented Oct 14, 2016

Thanks for the bug report. Please update to colored 1.3.1 which fixes the problem as the tests, and the example show (you can run cargo run --example=nested_colors to see @Br1oP's example passing).

If you have any issue or suggestion to make colored better, don't hesitate to submit an issue. Have a great day

Ref PR: colored-rs/colored#12

@Br1oP
Copy link
Member

Br1oP commented Oct 14, 2016

Cool, it works great now!

I'm closing this issue, thx.

@Br1oP Br1oP closed this as completed Oct 14, 2016
nasa42 added a commit to rust-lang/this-week-in-rust that referenced this issue Oct 17, 2016
@Razican
Copy link
Member Author

Razican commented Nov 9, 2016

This has been reopened in upstream, seems that we still have the problem: colored/#11

@Razican Razican reopened this Nov 9, 2016
@Razican Razican modified the milestones: SUPER 0.3.0, SUPER 0.2.0 Nov 9, 2016
@mackwic
Copy link

mackwic commented Nov 25, 2016

Again, thank you for the bug report. It should be ok, now 👍

@mackwic
Copy link

mackwic commented Nov 26, 2016

(please update to 1.3.2 by the way)

Razican added a commit that referenced this issue Nov 27, 2016
@Razican Razican closed this as completed Nov 27, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants