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


Message #10 received at 20482-done <at> debbugs.gnu.org (full text, mbox):

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 1 (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.