|
@@ -30,19 +30,19 @@ function IsATTY(var t : text) : Boolean;
|
|
|
|
|
|
const
|
|
const
|
|
(* This allows compile-time removal of the colouring functionality under not supported platforms *)
|
|
(* This allows compile-time removal of the colouring functionality under not supported platforms *)
|
|
-{$if defined(linux) or defined(MSWINDOWS) or defined(OS2) or defined(GO32V2) or defined(WATCOM)}
|
|
|
|
|
|
+{$if defined(linux) or defined(MSWINDOWS) or defined(OS2) or defined(GO32V2) or defined(WATCOM) or defined(DARWIN)}
|
|
TTYCheckSupported = true;
|
|
TTYCheckSupported = true;
|
|
-{$else defined(linux) or defined(MSWINDOWS) or defined(OS2) or defined(GO32V2) or defined(WATCOM)}
|
|
|
|
|
|
+{$else defined(linux) or defined(MSWINDOWS) or defined(OS2) or defined(GO32V2) or defined(WATCOM) or defined(DARWIN)}
|
|
TTYCheckSupported = false;
|
|
TTYCheckSupported = false;
|
|
-{$endif defined(linux) or defined(MSWINDOWS) or defined(OS2) or defined(GO32V2) or defined(WATCOM)}
|
|
|
|
|
|
+{$endif defined(linux) or defined(MSWINDOWS) or defined(OS2) or defined(GO32V2) or defined(WATCOM) or defined(DARWIN)}
|
|
|
|
|
|
|
|
|
|
implementation
|
|
implementation
|
|
|
|
|
|
-{$ifdef linux}
|
|
|
|
|
|
+{$if defined(linux) or defined(darwin)}
|
|
uses
|
|
uses
|
|
termio;
|
|
termio;
|
|
-{$endif linux}
|
|
|
|
|
|
+{$endif defined(linux) or defined(darwin)}
|
|
{$ifdef mswindows}
|
|
{$ifdef mswindows}
|
|
uses
|
|
uses
|
|
windows;
|
|
windows;
|
|
@@ -60,12 +60,12 @@ const
|
|
CachedIsATTY : Boolean = false;
|
|
CachedIsATTY : Boolean = false;
|
|
IsATTYValue : Boolean = false;
|
|
IsATTYValue : Boolean = false;
|
|
|
|
|
|
-{$ifdef linux}
|
|
|
|
|
|
+{$if defined(linux) or defined(darwin)}
|
|
function LinuxIsATTY(var t : text) : Boolean; inline;
|
|
function LinuxIsATTY(var t : text) : Boolean; inline;
|
|
begin
|
|
begin
|
|
LinuxIsATTY:=termio.IsATTY(t)=1;
|
|
LinuxIsATTY:=termio.IsATTY(t)=1;
|
|
end;
|
|
end;
|
|
-{$endif linux}
|
|
|
|
|
|
+{$endif defined(linux) or defined(darwin)}
|
|
|
|
|
|
{$ifdef MSWINDOWS}
|
|
{$ifdef MSWINDOWS}
|
|
const
|
|
const
|
|
@@ -152,9 +152,9 @@ begin
|
|
if not(CachedIsATTY) then
|
|
if not(CachedIsATTY) then
|
|
begin
|
|
begin
|
|
(* If none of the supported values is defined, false is returned by default. *)
|
|
(* If none of the supported values is defined, false is returned by default. *)
|
|
-{$ifdef linux}
|
|
|
|
|
|
+{$if defined(linux) or defined(darwin)}
|
|
IsATTYValue:=LinuxIsATTY(t);
|
|
IsATTYValue:=LinuxIsATTY(t);
|
|
-{$endif linux}
|
|
|
|
|
|
+{$endif defined(linux) or defined(darwin)}
|
|
{$ifdef MSWINDOWS}
|
|
{$ifdef MSWINDOWS}
|
|
IsATTYValue:=WindowsIsATTY(t);
|
|
IsATTYValue:=WindowsIsATTY(t);
|
|
{$endif MSWINDOWS}
|
|
{$endif MSWINDOWS}
|