--- /usr/bin/colordiff 2009-04-29 09:56:04.000000000 +0200 +++ /home/manu/bin/colordiff 2013-03-29 11:55:04.517409668 +0100 @@ -143,7 +143,7 @@ # If output is to a file, switch off colours, unless 'color_patch' is set # Relates to http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=378563 -if ((-f STDOUT) && ($color_patch == 0)) { +if (!(-t STDOUT) && ($color_patch == 0)) { $plain_text = ''; $file_old = ''; $file_new = ''; @@ -151,6 +151,9 @@ $cvs_stuff = ''; $plain_text = ''; $colour{off} = ''; +} else { + my $pager = $ENV{PAGER} || "less -r"; + open(STDOUT, "| $pager") or die "can't fork a pager: $!"; } my $specified_difftype;