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

reconsider failing on escape characters #40

Open
smthelusive opened this issue Oct 8, 2021 · 1 comment
Open

reconsider failing on escape characters #40

smthelusive opened this issue Oct 8, 2021 · 1 comment

Comments

@smthelusive
Copy link

Hello!

I was looking at this issue for ammonite. The problem comes from fansi, because it would fail anything that contains \u001b or \u009b if that's not a part of a valid color. So, something like this will fail:
fansi.Str("\u001b")
I understand that this was the idea, but maybe there's no need to fail on "invalid" strings like that? If fansi can't parse it, maybe let it be part of the string?
Please let me know what you think. I can also make a PR, if that makes sense.

@lihaoyi
Copy link
Member

lihaoyi commented Dec 4, 2021

fansi is meant to let you configure what you want to do with invalid strings

def apply(raw: CharSequence, errorMode: ErrorMode = ErrorMode.Throw): fansi.Str = {
. It sounds like Ammonite just needs to turn on that option

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

No branches or pull requests

2 participants