From f7113f29f9c7a63f2c936d4407b437b7e15e4a5e Mon Sep 17 00:00:00 2001
From: Andre Hofmeister <9199345+HofmeisterAn@users.noreply.github.com>
Date: Sat, 17 Jan 2026 08:10:52 +0100
Subject: [PATCH] fix: Do not set console buffer width
---
src/Testcontainers/Logger.cs | 21 ++++++++-------------
1 file changed, 8 insertions(+), 13 deletions(-)
diff --git a/src/Testcontainers/Logger.cs b/src/Testcontainers/Logger.cs
index 1b908c5d5..bb9b88f05 100644
--- a/src/Testcontainers/Logger.cs
+++ b/src/Testcontainers/Logger.cs
@@ -2,7 +2,6 @@ namespace DotNet.Testcontainers
{
using System;
using System.Diagnostics;
- using System.Runtime.InteropServices;
using JetBrains.Annotations;
using Microsoft.Extensions.Logging;
@@ -22,31 +21,31 @@ namespace DotNet.Testcontainers
/// internal sealed class UssDiscovery : ITestDiscoverer, ITestExecutor
/// {
/// private const string DllFileExtension = ".dll";
- ///
+ ///
/// private const string ExeFileExtension = ".exe";
- ///
+ ///
/// private const string ExecutorUri = "executor://testcontainers.org/v1";
- ///
+ ///
/// private const string Category = "managed";
- ///
+ ///
/// public void DiscoverTests(IEnumerable<string> sources, IDiscoveryContext discoveryContext, IMessageLogger logger, ITestCaseDiscoverySink discoverySink)
/// {
/// }
- ///
+ ///
/// public void RunTests(IEnumerable<TestCase> tests, IRunContext runContext, IFrameworkHandle frameworkHandle)
/// {
/// SetLogger(frameworkHandle);
/// }
- ///
+ ///
/// public void RunTests(IEnumerable<string> sources, IRunContext runContext, IFrameworkHandle frameworkHandle)
/// {
/// SetLogger(frameworkHandle);
/// }
- ///
+ ///
/// public void Cancel()
/// {
/// }
- ///
+ ///
/// private static void SetLogger(IMessageLogger logger)
/// {
/// // Set the TestcontainersSettings.Logger. Use a semaphore to block the test execution until the logger is set.
@@ -67,10 +66,6 @@ static ConsoleLogger()
private ConsoleLogger()
{
- if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows) && !Console.IsOutputRedirected && !Console.IsErrorRedirected)
- {
- Console.BufferWidth = short.MaxValue - 1;
- }
}
///