From 86ac28b005a6849799625011cce098c23db2152b Mon Sep 17 00:00:00 2001 From: Craig Mayhew Date: Sat, 11 Apr 2026 14:11:19 +0100 Subject: [PATCH] sanitize characters in log output to prevent garbled log screen --- flutter_app/lib/services/gateway_service.dart | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/flutter_app/lib/services/gateway_service.dart b/flutter_app/lib/services/gateway_service.dart index 2c61d6c..399f96b 100644 --- a/flutter_app/lib/services/gateway_service.dart +++ b/flutter_app/lib/services/gateway_service.dart @@ -101,12 +101,13 @@ class GatewayService { void _subscribeLogs() { _logSubscription?.cancel(); _logSubscription = NativeBridge.gatewayLogStream.listen((log) { - final logs = [..._state.logs, log]; + final sanitizedLog = log.replaceAll(AppConstants.ansiEscape, ''); + final logs = [..._state.logs, sanitizedLog]; if (logs.length > 500) { logs.removeRange(0, logs.length - 500); } String? dashboardUrl; - final cleanLog = _cleanForUrl(log); + final cleanLog = _cleanForUrl(sanitizedLog); final urlMatch = _tokenUrlRegex.firstMatch(cleanLog); if (urlMatch != null) { dashboardUrl = urlMatch.group(0);