Skip to content

Commit

Permalink
Add Alacritty as supported Ansi console
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxAtoms committed Apr 3, 2023
1 parent 70da3f4 commit 1334319
Showing 1 changed file with 19 additions and 18 deletions.
37 changes: 19 additions & 18 deletions src/Spectre.Console/Internal/Backends/Ansi/AnsiDetector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,25 @@ namespace Spectre.Console;

internal static class AnsiDetector
{
private static readonly Regex[] _regexes = new[]
private static readonly Regex[] _regexes =
{
new Regex("^xterm"), // xterm, PuTTY, Mintty
new Regex("^rxvt"), // RXVT
new Regex("^eterm"), // Eterm
new Regex("^screen"), // GNU screen, tmux
new Regex("tmux"), // tmux
new Regex("^vt100"), // DEC VT series
new Regex("^vt102"), // DEC VT series
new Regex("^vt220"), // DEC VT series
new Regex("^vt320"), // DEC VT series
new Regex("ansi"), // ANSI
new Regex("scoansi"), // SCO ANSI
new Regex("cygwin"), // Cygwin, MinGW
new Regex("linux"), // Linux console
new Regex("konsole"), // Konsole
new Regex("bvterm"), // Bitvise SSH Client
new Regex("^st-256color"), // Suckless Simple Terminal, st
new("^xterm"), // xterm, PuTTY, Mintty
new("^rxvt"), // RXVT
new("^eterm"), // Eterm
new("^screen"), // GNU screen, tmux
new("tmux"), // tmux
new("^vt100"), // DEC VT series
new("^vt102"), // DEC VT series
new("^vt220"), // DEC VT series
new("^vt320"), // DEC VT series
new("ansi"), // ANSI
new("scoansi"), // SCO ANSI
new("cygwin"), // Cygwin, MinGW
new("linux"), // Linux console
new("konsole"), // Konsole
new("bvterm"), // Bitvise SSH Client
new("^st-256color"), // Suckless Simple Terminal, st
new("alacritty"), // Alacritty
};

public static (bool SupportsAnsi, bool LegacyConsole) Detect(bool stdError, bool upgrade)
Expand Down Expand Up @@ -61,7 +62,7 @@ private static (bool SupportsAnsi, bool LegacyConsole) DetectFromTerm()
return (false, true);
}

internal static class Windows
private static class Windows
{
[SuppressMessage("StyleCop.CSharp.NamingRules", "SA1310:Field names should not contain underscore")]
private const int STD_OUTPUT_HANDLE = -11;
Expand Down

0 comments on commit 1334319

Please # to comment.