From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 19 11:34:35 2015 Received: (at submit) by debbugs.gnu.org; 19 Oct 2015 15:34:35 +0000 Received: from localhost ([127.0.0.1]:56891 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZoCSI-00027c-Go for submit@debbugs.gnu.org; Mon, 19 Oct 2015 11:34:35 -0400 Received: from eggs.gnu.org ([208.118.235.92]:39634) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZoA9T-00070L-6N for submit@debbugs.gnu.org; Mon, 19 Oct 2015 09:06:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZoA9P-0005mq-B1 for submit@debbugs.gnu.org; Mon, 19 Oct 2015 09:06:59 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_40 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:54259) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZoA9P-0005mg-8R for submit@debbugs.gnu.org; Mon, 19 Oct 2015 09:06:55 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49610) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZoA9L-0001AH-BS for bug-coreutils@gnu.org; Mon, 19 Oct 2015 09:06:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZoA9F-0005hK-1i for bug-coreutils@gnu.org; Mon, 19 Oct 2015 09:06:50 -0400 Received: from hz1.yz.to ([178.63.61.147]:50969) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZoA9E-0005g3-SN for bug-coreutils@gnu.org; Mon, 19 Oct 2015 09:06:44 -0400 Received: from [172.17.6.34] (ww2.tbz-pariv.de [194.113.71.71]) by hz1.yz.to (Postfix) with ESMTPSA id C3FC68157717 for ; Mon, 19 Oct 2015 15:06:40 +0200 (CEST) To: bug-coreutils@gnu.org From: =?UTF-8?Q?Thomas_G=c3=bcttler?= Subject: tee: preserve isatty(). Goal: show colors to user. Message-ID: <5624EAE2.2030009@thomas-guettler.de> Date: Mon, 19 Oct 2015 15:06:42 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.1 (----) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Mon, 19 Oct 2015 11:34:33 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.1 (----) It would be great if tee would allow this: tee preserves isatty(), thus the caller thinks this is a real terminal and outputs ansi color codes. Tee displays the ansi colors on the screen. The output to the file gets filtered by tee (remove ansi color codes). I would make this optional since I guess the result will be only 99% equal to the old result. Example: git diff | tee --show-colors git.diff The user sees the color, and the file "git.diff" contains the output with the color codes removed. Related: http://superuser.com/questions/352697/preserve-colors-while-pipi= ng-to-tee Regards, Thomas G=C3=BCttler --=20 Thomas Guettler http://www.thomas-guettler.de/ From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 19 12:05:26 2015 Received: (at 21711) by debbugs.gnu.org; 19 Oct 2015 16:05:26 +0000 Received: from localhost ([127.0.0.1]:56933 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZoCw9-0004QQ-MP for submit@debbugs.gnu.org; Mon, 19 Oct 2015 12:05:26 -0400 Received: from mail1.vodafone.ie ([213.233.128.43]:59587) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZoCw7-0004QI-6v for 21711@debbugs.gnu.org; Mon, 19 Oct 2015 12:05:23 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AiAbAJcTJVZtT8uM/2dsb2JhbABeKII8Uh81cIJbvRsjhTFHAQICgTpMAQEBAQEBgQuELgEBBCMPAVYLDQsCAgUWCwICCQMCAQIBRQYBDAgBAQWIKwEIsRmFb4xuAQshgSKEWoV5gkGCU4JpgUUFliOFGYokhwySbGOEBD2GGwEBAQ Received: from unknown (HELO localhost.localdomain) ([109.79.203.140]) by mail1.vodafone.ie with ESMTP; 19 Oct 2015 17:05:22 +0100 Subject: Re: bug#21711: tee: preserve isatty(). Goal: show colors to user. To: =?UTF-8?Q?Thomas_G=c3=bcttler?= , 21711@debbugs.gnu.org References: <5624EAE2.2030009@thomas-guettler.de> From: =?UTF-8?Q?P=c3=a1draig_Brady?= X-Enigmail-Draft-Status: N1110 Message-ID: <562514C2.7040200@draigBrady.com> Date: Mon, 19 Oct 2015 17:05:22 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <5624EAE2.2030009@thomas-guettler.de> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 21711 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) tag notabug close 21711 stop On 19/10/15 14:06, Thomas Güttler wrote: > It would be great if tee would allow this: > > tee preserves isatty(), thus the caller thinks this > is a real terminal and outputs ansi color codes. > > Tee displays the ansi colors on the screen. The output > to the file gets filtered by tee (remove ansi color codes). > > I would make this optional since I guess the result will be > only 99% equal to the old result. > > Example: > > git diff | tee --show-colors git.diff > > The user sees the color, and the file "git.diff" contains > the output with the color codes removed. > > Related: http://superuser.com/questions/352697/preserve-colors-while-piping-to-tee The options provided there are really all that is possible I think. I.E. tell the command writing to the pipe, that it should consider it a terminal. Since tee is "behind the pipe" it can't influence the writer to the pipe. If you really want the color terminal codes in git.diff then you can: git diff --color=always | tee git.diff If you also want an appropriate pager: git diff --color=always | tee git.diff | less -R If you want just the diff without color codes in the file then you can color easily after the fact with something like: http://www.pixelbeat.org/scripts/idiff git diff | tee git.diff | idiff cheers, Pádraig. From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 19 12:29:28 2015 Received: (at control) by debbugs.gnu.org; 19 Oct 2015 16:29:28 +0000 Received: from localhost ([127.0.0.1]:56945 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZoDJQ-0004xl-Fc for submit@debbugs.gnu.org; Mon, 19 Oct 2015 12:29:28 -0400 Received: from mail1.vodafone.ie ([213.233.128.43]:40778) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZoDJO-0004xY-LD for control@debbugs.gnu.org; Mon, 19 Oct 2015 12:29:26 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvMOAG8ZJVZtT8uM/2dsb2JhbABeKII8UiN5gW+BFIoisnmGFjWBEEwBAQEBAQGBC4RNCipUDQIFFgsCCwMCAQIBOQYCAggNCAEBiDABoTuPcYVvjRyBIoRajTsMLxSBMQWWI5ZJkmxjgUoBAQEHAQEBAYIsPYYbAgEC Received: from unknown (HELO localhost.localdomain) ([109.79.203.140]) by mail1.vodafone.ie with ESMTP; 19 Oct 2015 17:29:25 +0100 To: GNU bug tracker automated control server From: =?UTF-8?Q?P=c3=a1draig_Brady?= Message-ID: <56251A64.8000606@draigBrady.com> Date: Mon, 19 Oct 2015 17:29:24 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Spam-Score: 2.0 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: tag 21711 notabug close 21711 stop [...] Content analysis details: (2.0 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [213.233.128.43 listed in list.dnswl.org] 1.8 MISSING_SUBJECT Missing Subject: header 0.2 NO_SUBJECT Extra score for no subject X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 2.0 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: tag 21711 notabug close 21711 stop [...] Content analysis details: (2.0 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [213.233.128.43 listed in list.dnswl.org] 1.8 MISSING_SUBJECT Missing Subject: header 0.2 NO_SUBJECT Extra score for no subject tag 21711 notabug close 21711 stop From unknown Fri Aug 15 17:22:07 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 17 Nov 2015 12:24:07 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator