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

escape codes from ansi-escapes not being stripped by strip-ansi? #19

Closed
derhuerst opened this issue Mar 11, 2018 · 4 comments
Closed

escape codes from ansi-escapes not being stripped by strip-ansi? #19

derhuerst opened this issue Mar 11, 2018 · 4 comments
Assignees
Labels

Comments

@derhuerst
Copy link

derhuerst commented Mar 11, 2018

Hey, thanks for this useful tool!

If I understand correctly, the following escape codes should be stripped by strip-ansi, right?

const esc = require('ansi-escapes')
const stripAnsi = require('strip-ansi')

esc.scrollDown // '\u001b[T'
stripAnsi(esc.scrollDown) // '\u001b[T'
esc.beep // '\u0007'
stripAnsi(esc.beep) // '\u0007'

clearScreen gets stripped though:

esc.clearScreen // '\u001bc'
stripAnsi(esc.clearScreen) // ''
@Qix-
Copy link
Member

Qix- commented Mar 12, 2018

Beep won't. scrollDown should. Let me look :)

@Qix- Qix- added the bug label Mar 12, 2018
@Qix- Qix- self-assigned this Mar 12, 2018
@Qix- Qix- mentioned this issue Mar 12, 2018
@Qix-
Copy link
Member

Qix- commented Mar 12, 2018

#20 fixes this - good catch :)

@Qix-
Copy link
Member

Qix- commented Mar 12, 2018

To be clear, beep isn't actually an escape code. It's considered a valid ASCII character that has nothing to do with escapes and the like. It'd be out of scope for this module.

cc @sindresorhus, not sure you opinion on it. It has a property in ansi-escapes but it isn't really an escape.

@derhuerst
Copy link
Author

To be clear, beep isn't actually an escape code. It's considered a valid ASCII character that has nothing to do with escapes and the like. It'd be out of scope for this module.

Yeah, makes sense now that I look at it again.

#20 fixes this - good catch :)

Cool!

sindresorhus pushed a commit that referenced this issue Sep 18, 2018
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

2 participants