mirror of
https://github.com/nsnail/spectre.console.git
synced 2025-04-16 08:52:50 +08:00
Merge pull request #1211 from MaxAtoms/main
This commit is contained in:
commit
d64d3ec770
@ -7,24 +7,25 @@ namespace Spectre.Console;
|
|||||||
|
|
||||||
internal static class AnsiDetector
|
internal static class AnsiDetector
|
||||||
{
|
{
|
||||||
private static readonly Regex[] _regexes = new[]
|
private static readonly Regex[] _regexes =
|
||||||
{
|
{
|
||||||
new Regex("^xterm"), // xterm, PuTTY, Mintty
|
new("^xterm"), // xterm, PuTTY, Mintty
|
||||||
new Regex("^rxvt"), // RXVT
|
new("^rxvt"), // RXVT
|
||||||
new Regex("^eterm"), // Eterm
|
new("^eterm"), // Eterm
|
||||||
new Regex("^screen"), // GNU screen, tmux
|
new("^screen"), // GNU screen, tmux
|
||||||
new Regex("tmux"), // tmux
|
new("tmux"), // tmux
|
||||||
new Regex("^vt100"), // DEC VT series
|
new("^vt100"), // DEC VT series
|
||||||
new Regex("^vt102"), // DEC VT series
|
new("^vt102"), // DEC VT series
|
||||||
new Regex("^vt220"), // DEC VT series
|
new("^vt220"), // DEC VT series
|
||||||
new Regex("^vt320"), // DEC VT series
|
new("^vt320"), // DEC VT series
|
||||||
new Regex("ansi"), // ANSI
|
new("ansi"), // ANSI
|
||||||
new Regex("scoansi"), // SCO ANSI
|
new("scoansi"), // SCO ANSI
|
||||||
new Regex("cygwin"), // Cygwin, MinGW
|
new("cygwin"), // Cygwin, MinGW
|
||||||
new Regex("linux"), // Linux console
|
new("linux"), // Linux console
|
||||||
new Regex("konsole"), // Konsole
|
new("konsole"), // Konsole
|
||||||
new Regex("bvterm"), // Bitvise SSH Client
|
new("bvterm"), // Bitvise SSH Client
|
||||||
new Regex("^st-256color"), // Suckless Simple Terminal, st
|
new("^st-256color"), // Suckless Simple Terminal, st
|
||||||
|
new("alacritty"), // Alacritty
|
||||||
};
|
};
|
||||||
|
|
||||||
public static (bool SupportsAnsi, bool LegacyConsole) Detect(bool stdError, bool upgrade)
|
public static (bool SupportsAnsi, bool LegacyConsole) Detect(bool stdError, bool upgrade)
|
||||||
@ -61,7 +62,7 @@ internal static class AnsiDetector
|
|||||||
return (false, true);
|
return (false, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
internal static class Windows
|
private static class Windows
|
||||||
{
|
{
|
||||||
[SuppressMessage("StyleCop.CSharp.NamingRules", "SA1310:Field names should not contain underscore")]
|
[SuppressMessage("StyleCop.CSharp.NamingRules", "SA1310:Field names should not contain underscore")]
|
||||||
private const int STD_OUTPUT_HANDLE = -11;
|
private const int STD_OUTPUT_HANDLE = -11;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user