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

text is leaking #9

Open
devmondo opened this issue Jun 15, 2019 · 7 comments
Open

text is leaking #9

devmondo opened this issue Jun 15, 2019 · 7 comments
Labels
bug Something isn't working

Comments

@devmondo
Copy link

Hi,
i don't know what is happening exactly, but i think the picture below explains it better than words.

image

@jbcarpanelli jbcarpanelli added the bug Something isn't working label Jun 15, 2019
@jbcarpanelli
Copy link
Owner

jbcarpanelli commented Jun 15, 2019

Hi @devmondo! Thanks for raising this issue. I'm not being able to reproduce it, but I believe that this might have something to do with using chalk (I noticed different colors for the Step: label and the rest of the text). This is basically because spinnies counts the number of characters in each spinner line to clean the stream, and is counting the color characters that chalk appends and preppends to the text.
That being said, I'm pretty sure you will get rid of this bug just by avoiding using chalk to color the Step: label for now until I release a fix.

@devmondo
Copy link
Author

hi @jcarpanelli , thanks for the prompt reply,

indeed i am using chalk to color parts as you said, i will disable it for now as you said until the fix.

thanks alot :)

@jbcarpanelli
Copy link
Owner

jbcarpanelli commented Jun 16, 2019

Hi, @devmondo! I've just released a new version, v0.4.0. Could you please confirm whether your issue has been fixed or not? If not, I'll have to ask you more info in order to reproduce it.

@devmondo
Copy link
Author

Hi @jcarpanelli!

thanks a lot for the work, I made tests and it is better now, the text and color are not getting mangled like in the first picture I posted, but still text is leaking. if you look at the picture below you would see the word, started is leaking to the previous console lines.

please let me know how I can help with more info and I hope I am not wasting your time.

image

@jbcarpanelli
Copy link
Owner

jbcarpanelli commented Jun 17, 2019

Another question @devmondo! Are you adding line breaks to any spinner message using \n? Something such as:

spinner.add('foo', { text: 'hello!' });
spinners.update('foo', { text: `hello\nI'm\na\nspinner!` });

And last question: Is the Backround: PLEX-100-create case > background is finished started text in the first two lines of the first picture being printed by spinnies? If not, that might be the issue. If any spinner is active, you shouldn't write the stderr/stdout without using spinnies, that's the main reason of having the non-spinnable status option (and btw, this is by design).

@devmondo
Copy link
Author

@jcarpanelli ,
thanks a lot for the detailed answer!

yes, you are correct, on both counts. I am using a new line in spinnies at the end of the sentence.

and Background: PLEX-100-create case > background is finished started is indeed printed out with console.log and not spinnies.

I will try to convert all those console.log to non-spinnable ones and see if it solves the issue.

thanks a lot for the time and effort. i will work on it and let you know.

@jbcarpanelli
Copy link
Owner

jbcarpanelli commented Jun 18, 2019

Ok, great! I've just released v0.4.2 with a small fix when using \n characters. Now your problem should be only caused by those console.logs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants