mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-13 21:44:16 +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
|
@ -143,16 +143,25 @@ static void err(const wchar_t *blah, ...)
|
||||||
va_list va;
|
va_list va;
|
||||||
va_start(va, blah);
|
va_start(va, blah);
|
||||||
err_count++;
|
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
|
// show errors in red
|
||||||
fputs("\x1b[31m", stdout);
|
if (colorize)
|
||||||
|
{
|
||||||
|
fputs("\x1b[31m", stdout);
|
||||||
|
}
|
||||||
|
|
||||||
wprintf(L"Error: ");
|
wprintf(L"Error: ");
|
||||||
vwprintf(blah, va);
|
vwprintf(blah, va);
|
||||||
va_end(va);
|
va_end(va);
|
||||||
|
|
||||||
// return to normal color
|
// return to normal color
|
||||||
fputs("\x1b[0m", stdout);
|
if (colorize)
|
||||||
|
{
|
||||||
|
fputs("\x1b[0m", stdout);
|
||||||
|
}
|
||||||
|
|
||||||
wprintf(L"\n");
|
wprintf(L"\n");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue