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 · May be fixed by #1516
Open

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

Ttxman opened this issue Nov 28, 2023 · 0 comments · May be fixed by #1516
Labels
bug Something isn't working needs triage

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.

@Ttxman Ttxman added bug Something isn't working needs triage labels Nov 28, 2023
@github-project-automation github-project-automation bot moved this to Todo 🕑 in Spectre Console Nov 28, 2023
@BlazeFace BlazeFace linked a pull request Apr 14, 2024 that will close this issue
6 tasks
@github-actions github-actions bot added the ⭐ top bug Top bug. label Apr 15, 2024
@github-actions github-actions bot removed the ⭐ top bug Top bug. label Sep 6, 2024
@FrankRay78 FrankRay78 linked a pull request Nov 13, 2024 that will close this issue
6 tasks
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
Projects
Status: Todo 🕑
Development

Successfully merging a pull request may close this issue.

1 participant