From eac433a22ca99da724395f3b4e371dd8037c7509 Mon Sep 17 00:00:00 2001 From: Lukas Gasselsberger | alu-one Date: Tue, 16 Jun 2026 13:17:19 +0200 Subject: [PATCH 1/3] Use different ansi escape code for yellow on gitlab --- src/Fallout.Build/Host.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Fallout.Build/Host.cs b/src/Fallout.Build/Host.cs index 96587489a..e0580a5c0 100644 --- a/src/Fallout.Build/Host.cs +++ b/src/Fallout.Build/Host.cs @@ -33,7 +33,9 @@ protected internal void WriteLogo() // True-color ANSI for Fallout yellow (#F5C800). Modern terminals // (Windows Terminal, VS Code, macOS Terminal.app, GitHub Actions logs) // render this directly; older sinks ignore the escape bytes. - const string Y = ""; + string Y = Environment.GetEnvironmentVariable("GITLAB_CI") == "true" + ? "" + : ""; const string D = ""; const string R = ""; From 5ca5cf473a94958de8c1446e4e36668aac886c9e Mon Sep 17 00:00:00 2001 From: Lukas Gasselsberger | alu-one Date: Tue, 16 Jun 2026 13:34:56 +0200 Subject: [PATCH 2/3] Make ansi colors overridable --- src/Fallout.Build/Host.cs | 68 +++++++++++++++----------- src/Fallout.Common/CI/GitLab/GitLab.cs | 5 +- 2 files changed, 43 insertions(+), 30 deletions(-) diff --git a/src/Fallout.Build/Host.cs b/src/Fallout.Build/Host.cs index e0580a5c0..fb47bcd24 100644 --- a/src/Fallout.Build/Host.cs +++ b/src/Fallout.Build/Host.cs @@ -27,48 +27,53 @@ protected Host() internal virtual string OutputTemplate => Logging.TimestampOutputTemplate; + // True-color ANSI for Fallout yellow (#F5C800). Modern terminals + // (Windows Terminal, VS Code, macOS Terminal.app, GitHub Actions logs) + // render this directly; older sinks ignore the escape bytes. + + protected virtual string LogoYellow { get => ""; } + + protected virtual string LogoDark { get => ""; } + + protected virtual string LogoReset { get => ""; } + protected internal void WriteLogo() { Debug(); - // True-color ANSI for Fallout yellow (#F5C800). Modern terminals - // (Windows Terminal, VS Code, macOS Terminal.app, GitHub Actions logs) - // render this directly; older sinks ignore the escape bytes. - string Y = Environment.GetEnvironmentVariable("GITLAB_CI") == "true" - ? "" - : ""; - const string D = ""; - const string R = ""; new[] { - $"{Y}███████╗ █████╗ ██╗ ██╗ ██████╗ ██╗ ██╗████████╗{R}", - $"{Y}██╔════╝██╔══██╗██║ ██║ ██╔═══██╗██║ ██║╚══██╔══╝{R}", - $"{Y}█████╗ ███████║██║ ██║ ██║ ██║██║ ██║ ██║ {R}", - $"{Y}██╔══╝ ██╔══██║██║ ██║ ██║ ██║██║ ██║ ██║ {R}", - $"{Y}██║ ██║ ██║███████╗███████╗╚██████╔╝╚██████╔╝ ██║ {R}", - $"{Y}╚═╝ ╚═╝ ╚═╝╚══════╝╚══════╝ ╚═════╝ ╚═════╝ ╚═╝ {R}", + $"{LogoYellow}███████╗ █████╗ ██╗ ██╗ ██████╗ ██╗ ██╗████████╗{LogoReset}", + $"{LogoYellow}██╔════╝██╔══██╗██║ ██║ ██╔═══██╗██║ ██║╚══██╔══╝{LogoReset}", + $"{LogoYellow}█████╗ ███████║██║ ██║ ██║ ██║██║ ██║ ██║ {LogoReset}", + $"{LogoYellow}██╔══╝ ██╔══██║██║ ██║ ██║ ██║██║ ██║ ██║ {LogoReset}", + $"{LogoYellow}██║ ██║ ██║███████╗███████╗╚██████╔╝╚██████╔╝ ██║ {LogoReset}", + $"{LogoYellow}╚═╝ ╚═╝ ╚═╝╚══════╝╚══════╝ ╚═════╝ ╚═════╝ ╚═╝ {LogoReset}", string.Empty, - $" {D}.NET build system{R}", - $" {Y}☢{R} {D}survived the NUKE{R}" + $" {LogoDark}.NET build system{LogoReset}", + $" {LogoYellow}☢{LogoReset} {LogoDark}survived the NUKE{LogoReset}" }.ForEach(x => Debug(x.Replace(" ", " "))); + Debug(); } protected internal virtual IDisposable WriteBlock(string text) { - return DelegateDisposable.CreateBracket( - () => - { - var formattedBlockText = text - .Split(new[] { EnvironmentInfo.NewLine }, StringSplitOptions.None) - .Select(Theme.FormatInformation); - - Debug(); - Debug("╬" + '═'.Repeat(text.Length + 5)); - formattedBlockText.ForEach(x => Debug($"║ {x}")); - Debug("╬" + '═'.Repeat(Math.Max(text.Length - 4, 2))); - Debug(); - }); + return DelegateDisposable.CreateBracket(() => + { + var formattedBlockText = text + .Split(new[] + { + EnvironmentInfo.NewLine + }, StringSplitOptions.None) + .Select(Theme.FormatInformation); + + Debug(); + Debug("╬" + '═'.Repeat(text.Length + 5)); + formattedBlockText.ForEach(x => Debug($"║ {x}")); + Debug("╬" + '═'.Repeat(Math.Max(text.Length - 4, 2))); + Debug(); + }); } protected internal virtual void ReportWarning(string text, string details = null) @@ -146,18 +151,23 @@ static string GetInformation(ExecutableTarget target) case ExecutionStatus.Skipped: Debug(line); break; + case ExecutionStatus.Succeeded: Success(line); break; + case ExecutionStatus.Aborted: case ExecutionStatus.NotRun: Warning(line); break; + case ExecutionStatus.Failed: Error(line); break; + case ExecutionStatus.Collective: break; + default: throw new NotSupportedException(target.Status.ToString()); } diff --git a/src/Fallout.Common/CI/GitLab/GitLab.cs b/src/Fallout.Common/CI/GitLab/GitLab.cs index c89fe2746..37c6a7e2f 100644 --- a/src/Fallout.Common/CI/GitLab/GitLab.cs +++ b/src/Fallout.Common/CI/GitLab/GitLab.cs @@ -1,6 +1,5 @@ using System; using System.Diagnostics.CodeAnalysis; -using System.Linq; using Fallout.Common.Utilities; namespace Fallout.Common.CI.GitLab; @@ -19,6 +18,10 @@ public partial class GitLab : Host, IBuildServer private const string SectionStartSequence = "\u001b[0K"; private const string SectionResetSequence = "\r\u001b[0K"; + protected override string LogoYellow => ""; + + protected override string LogoDark => ""; + private readonly Action _messageSink; internal GitLab() From f260fafc7aea931d01a2f8aa40f408996193787b Mon Sep 17 00:00:00 2001 From: ITaluone <44049228+ITaluone@users.noreply.github.com> Date: Wed, 24 Jun 2026 10:58:35 +0200 Subject: [PATCH 3/3] Rename LogoDark to LogoDimmed --- src/Fallout.Build/Host.cs | 6 +++--- src/Fallout.Common/CI/GitLab/GitLab.cs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Fallout.Build/Host.cs b/src/Fallout.Build/Host.cs index fb47bcd24..953e5a580 100644 --- a/src/Fallout.Build/Host.cs +++ b/src/Fallout.Build/Host.cs @@ -33,7 +33,7 @@ protected Host() protected virtual string LogoYellow { get => ""; } - protected virtual string LogoDark { get => ""; } + protected virtual string LogoDimmed { get => ""; } protected virtual string LogoReset { get => ""; } @@ -50,8 +50,8 @@ protected internal void WriteLogo() $"{LogoYellow}██║ ██║ ██║███████╗███████╗╚██████╔╝╚██████╔╝ ██║ {LogoReset}", $"{LogoYellow}╚═╝ ╚═╝ ╚═╝╚══════╝╚══════╝ ╚═════╝ ╚═════╝ ╚═╝ {LogoReset}", string.Empty, - $" {LogoDark}.NET build system{LogoReset}", - $" {LogoYellow}☢{LogoReset} {LogoDark}survived the NUKE{LogoReset}" + $" {LogoDimmed}.NET build system{LogoReset}", + $" {LogoYellow}☢{LogoReset} {LogoDimmed}survived the NUKE{LogoReset}" }.ForEach(x => Debug(x.Replace(" ", " "))); Debug(); diff --git a/src/Fallout.Common/CI/GitLab/GitLab.cs b/src/Fallout.Common/CI/GitLab/GitLab.cs index 37c6a7e2f..8c420de14 100644 --- a/src/Fallout.Common/CI/GitLab/GitLab.cs +++ b/src/Fallout.Common/CI/GitLab/GitLab.cs @@ -20,7 +20,7 @@ public partial class GitLab : Host, IBuildServer protected override string LogoYellow => ""; - protected override string LogoDark => ""; + protected override string LogoDimmed => ""; private readonly Action _messageSink;