spectre.console
spectre.console copied to clipboard
Windows 2012R2 Error System.NotSupportedException
Information
- OS: Windows 2012 R2
- Terminal: Windows Terminal
I feel a bit dumb having gone this far without considering the impacts. I developed my console app using dotnet 5 on Windows 10. The deployment target is Windows 2012R2 (has dotnet Core installed appropriately, runs other dotnet core apps just fine).
My semi-educated guess is that I simply cannot use Spectre.Console in the Windows 2012 world.
When I run it and use the SelectionPrompt(), I get the following error:
Unhandled Exception. System.NotSupportedException: Cannot show selection prompt since current terminal does not support ANSI escape sequences.
It's basically this:
string f = AnsiConsole.Prompt(
new SelectionPrompt<string>()
.Title("Select fruit?")
.Mode (SelectionMode.Independent)
.HighlightStyle(Style.Plain)
.AddChoices( new[] {"Apple", "Pear"})
);

@jsreynolds Some functionality in Spectre.Console, such as some prompts, requires a terminal that knows how to interpret VT/ANSI sequences. Sadly, cmd.exe in versions prior to Windows 10 (build 16257) does not support that.
Note: Revisit this once we've shipped 1.0. We might be able to support this scenario using the VT/ANSI emulation layer in https://github.com/spectreconsole/terminal
Hi,
Is there any fix for this, we are facing same issue in Windows Server 2012R2 .
@chukkalasandeep Sadly, there is no fix for this. We would need some kind of ANSI command sequence emulator for this, and we don't have one.
Since Windows Server 2012(R2) is out of official support as well, I don't see us adding support for this at this point.