Skip to content

Commit

Permalink
Pretty print for Xcode 15 console
Browse files Browse the repository at this point in the history
  • Loading branch information
vkedwardli committed May 30, 2024
1 parent 2c68a21 commit b6c09a6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion shell/apple/emulator-osx/emulator-osx/osx-main.mm
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ int darw_printf(const char* text, ...)
va_end(args);

NSString* log = [NSString stringWithCString:temp encoding: NSUTF8StringEncoding];
static bool isXcode = [[[NSProcessInfo processInfo] environment][@"OS_ACTIVITY_DT_MODE"] boolValue];
NSDictionary<NSString *, NSString *>* env = [[NSProcessInfo processInfo] environment];
static bool isXcode = [env[@"OS_ACTIVITY_DT_MODE"] boolValue] || [env[@"COMMAND_MODE"] isEqualToString:@"unix2003"];

if (isXcode) // Xcode console does not support colors
{
log = [log stringByReplacingOccurrencesOfString:@"\x1b[0m" withString:@""];
Expand Down

0 comments on commit b6c09a6

Please sign in to comment.