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 curly brackets passed to AnsiConsole.Write() #39

Merged
merged 2 commits into from
May 28, 2024

Conversation

codeconscious
Copy link
Owner

@codeconscious codeconscious commented Apr 10, 2024

This is a workaround for a possible bug in the Spectre.Console library that causes crashes due to unexpected text formatting operations when strings contain { and }. AnsiConsole.Write() is affected, but AnsiConsole.WriteLine() is not.

We can avoid the issue by explicitly escaping the curly brackets (by doubling them) in strings passed to AnsiConsole.Write().

@codeconscious codeconscious added the bug Something isn't working label Apr 10, 2024
@codeconscious codeconscious self-assigned this Apr 10, 2024
@codeconscious codeconscious changed the title Escape text sent to AnsiConsole.Write() Escape curly brackets passed to AnsiConsole.Write() Apr 10, 2024
@codeconscious codeconscious merged commit 348fbc5 into main May 28, 2024
1 check passed
@codeconscious codeconscious deleted the fix/ansiconsole-write-exception branch May 28, 2024 07:52
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

Successfully merging this pull request may close these issues.

1 participant