mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-19 03:24:09 +00:00
Process: Add sys::Process::FileDescriptorHasColors().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160557 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -249,16 +249,18 @@ static bool terminalHasColors() {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Process::FileDescriptorHasColors(int fd) {
|
||||
// A file descriptor has colors if it is displayed and the terminal has
|
||||
// colors.
|
||||
return FileDescriptorIsDisplayed(fd) && terminalHasColors();
|
||||
}
|
||||
|
||||
bool Process::StandardOutHasColors() {
|
||||
if (!StandardOutIsDisplayed())
|
||||
return false;
|
||||
return terminalHasColors();
|
||||
return FileDescriptorHasColors(STDOUT_FILENO);
|
||||
}
|
||||
|
||||
bool Process::StandardErrHasColors() {
|
||||
if (!StandardErrIsDisplayed())
|
||||
return false;
|
||||
return terminalHasColors();
|
||||
return FileDescriptorHasColors(STDERR_FILENO);
|
||||
}
|
||||
|
||||
bool Process::ColorNeedsFlush() {
|
||||
|
Reference in New Issue
Block a user