Skip to content

Commit

Permalink
Escapes ANSI codes in announcements
Browse files Browse the repository at this point in the history
  • Loading branch information
waldekmastykarz committed Jan 7, 2025
1 parent 76f2bea commit 9adc32d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions dev-proxy/Announcement.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

using System.Text.RegularExpressions;

namespace Microsoft.DevProxy;

static class Announcement
Expand All @@ -12,6 +14,9 @@ public static async Task ShowAsync()
var announcement = await GetAsync();
if (!string.IsNullOrEmpty(announcement))
{
// Unescape the announcement to remove any escape characters
// in case we're using ANSI escape codes for color formatting
announcement = Regex.Unescape(announcement);
await Console.Error.WriteLineAsync(announcement);
}
}
Expand Down

0 comments on commit 9adc32d

Please sign in to comment.