GNU bug report logs - #20482
Colour of Terminal changes with some files using cat

Previous Next

Package: coreutils;

Reported by: Nikita Yerenkov-Scott <yerenkov.scott <at> gmail.com>

Date: Fri, 1 May 2015 15:27:01 UTC

Severity: normal

Tags: notabug

Done: Eric Blake <eblake <at> redhat.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Eric Blake <eblake <at> redhat.com>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#20482: closed (Colour of Terminal changes with some files
 using cat)
Date: Fri, 01 May 2015 15:40:03 +0000
[Message part 1 (text/plain, inline)]
Your message dated Fri, 01 May 2015 09:38:58 -0600
with message-id <55439E12.7070106 <at> redhat.com>
and subject line Re: bug#20482: Colour of Terminal changes with some files using cat
has caused the debbugs.gnu.org bug report #20482,
regarding Colour of Terminal changes with some files using cat
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
20482: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=20482
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Nikita Yerenkov-Scott <yerenkov.scott <at> gmail.com>
To: bug-coreutils <at> gnu.org
Subject: Colour of Terminal changes with some files using cat
Date: Fri, 1 May 2015 12:37:48 +0100
[Message part 3 (text/plain, inline)]
I have noticed that when running 'cat' to look at certain files that for
some reason the end of the file is in a different embolden colour, which
then makes all of my Terminal text that colour as well as bold.

An example is when I ran: cat /bin/systemd-ask-password

And this is what happened (Bold_Red_Terminal_Cat_Command.bmp):


​
And this is the colour that I should be seeing (Terminal_prompt_normal.bmp):



And the only way to get rid of the strange styling change and to return to
normal appears to be to restart Terminal or to view a file which does not
have this very strange effect.
​
[Message part 4 (text/html, inline)]
[Terminal_prompt_normal.bmp (image/bmp, inline)]
[Bold_Red_Terminal_Cat_Command.bmp (image/bmp, inline)]
[Bold_Red_Terminal_Cat_Command.bmp (image/bmp, attachment)]
[Terminal_prompt_normal.bmp (image/bmp, attachment)]
[Message part 9 (message/rfc822, inline)]
From: Eric Blake <eblake <at> redhat.com>
To: Nikita Yerenkov-Scott <yerenkov.scott <at> gmail.com>,
 20482-done <at> debbugs.gnu.org
Cc: control <at> bugs.debian.org
Subject: Re: bug#20482: Colour of Terminal changes with some files using cat
Date: Fri, 01 May 2015 09:38:58 -0600
[Message part 10 (text/plain, inline)]
tag 20482 notabug
thanks

On 12/31/1969 05:00 PM,  wrote:
> I have noticed that when running 'cat' to look at certain files that for
> some reason the end of the file is in a different embolden colour, which
> then makes all of my Terminal text that colour as well as bold.
> 
> An example is when I ran: cat /bin/systemd-ask-password
> 
> And this is what happened (Bold_Red_Terminal_Cat_Command.bmp):

Please do NOT attach megabytes of screenshots into something that will
be disseminated via mailing list to multiple readers.  At a minimum,
compress your image using a sane format like .png (rather than blasting
out an uncompressed .bmp) or further compress it with xz or gzip, even
better is to merely post a URL to a link that is hosting the image for
those that want to see it, without clogging inboxes of all list readers.

That said, this is not a bug in cat, but a problem with you making the
mistake of using 'cat' on a binary file, where the file had embedded
byte sequences that the terminal interpreted as commands to change the
terminal color.  It is never a good idea to cat a binary file to the
terminal, but we cannot change the behavior of cat (which is required to
operate on binary files) nor of the terminal (which must operate on
terminal command sequences as requested).

Meanwhile, you can try and reset your terminal back to normal color by
doing things like 'tput reset' or even 'ls -d . --color=always'.

As this is not a bug in coreutils, I'm closing out the bug report;
however, feel free to ask further questions on the topic.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

[signature.asc (application/pgp-signature, attachment)]

This bug report was last modified 10 years and 76 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.