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

AnsiConsole.Write(string) tries to use input as format string.. #1387

Open
Ttxman opened this issue Nov 28, 2023 · 0 comments
Open

AnsiConsole.Write(string) tries to use input as format string.. #1387

Ttxman opened this issue Nov 28, 2023 · 0 comments
Labels
bug Something isn't working needs triage ⭐ top bug Top bug.

Comments

@Ttxman
Copy link

Ttxman commented Nov 28, 2023

Information

  • OS: Windows
  • Version: 0.48.0
  • Terminal: Windows Terminal

Describe the bug
AnsiConsole.Write(string value) is calling AnsiConsole.Write(String format, Object[] args) this have some unexpected and undocumented behaviour:

  • Call throws exceptions when string contains double braces and is not valid format string for string.Format
  • When the string could be valid format string and have single parameter like "test {0}" some internal data (Spectre.Console.Style) is passed to the format.
  • When there is more than one format parameter like "test {0} {1}" it throws another Format exception.

To Reproduce
Just call AnsiConsole.Write("{") or AnsiConsole.Write("test {0}") or AnsiConsole.Write("test {0} {1}")

Expected behavior
String passed as parameter to AnsiConsole.Write is just shown in console..

Screenshots
image
image


Please upvote 👍 this issue if you are interested in it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs triage ⭐ top bug Top bug.
Projects
Status: Todo 🕑
Development

No branches or pull requests

1 participant