mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-26 12:53:13 +00:00
Don't try to colorize errors when running in Xcode
This commit is contained in:
parent
33c714ca03
commit
cb480dddf6
1 changed files with 11 additions and 2 deletions
|
@ -144,15 +144,24 @@ static void err(const wchar_t *blah, ...)
|
|||
va_start(va, blah);
|
||||
err_count++;
|
||||
|
||||
// Xcode's term doesn't support color (even though TERM claims it does)
|
||||
bool colorize = ! getenv("RUNNING_IN_XCODE");
|
||||
|
||||
// show errors in red
|
||||
if (colorize)
|
||||
{
|
||||
fputs("\x1b[31m", stdout);
|
||||
}
|
||||
|
||||
wprintf(L"Error: ");
|
||||
vwprintf(blah, va);
|
||||
va_end(va);
|
||||
|
||||
// return to normal color
|
||||
if (colorize)
|
||||
{
|
||||
fputs("\x1b[0m", stdout);
|
||||
}
|
||||
|
||||
wprintf(L"\n");
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue