Bug 2112593

Summary: Error using custom ~/.dir_colors/DIR_COLORS
Product: [Fedora] Fedora Reporter: Dimitris <centos>
Component: coreutilsAssignee: Kamil Dudka <kdudka>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 36CC: admiller, jamartis, jarodwilson, kdudka, kzak, ooprala, ovasik, p, sebastian.kisela, svashisht
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: coreutils-9.1-6.fc37 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-08-08 15:16:09 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Dimitris 2022-07-30 21:00:40 UTC
Description of problem:

The /etc/DIRCOLORS file mentions that we can create a copy of itself under ~/.dir_colors in order to customize the various colors of "ls".

Unfortunately, when I do that, each time a terminal window (gnome-terminal) opens, it produces the following error:

/usr/bin/cat: /home/user/.dir_colors: Is a directory


Version-Release number of selected component (if applicable):

coreutils-common (at least that is what I when from "dnf provides /etc/profile.d/colorls.sh"


How reproducible:

always!


Steps to Reproduce:
1. mkdir ~/.dir_colors
2. cp /etc/DIR_COLORS ~/.dir_colors
3. gnome-terminal

Actual results:

/usr/bin/cat: /home/user/.dir_colors: Is a directory


Expected results:

No error.


Additional info:

Thank you!

Comment 1 Kamil Dudka 2022-08-01 10:54:08 UTC
~/.dir_colors should not be a directory, it should be a regular file.  You can use a copy of /etc/DIR_COLORS to begin with but save it directly as ~/.dir_colors (without creating any directory).

Comment 2 Dimitris 2022-08-01 11:23:12 UTC
Ah, I see!

I got confused by the instructions at the top of the DIR_COLORS file, which says:

# You can copy this file to .dir_colors in your $HOME directory to override

I interpreted "to .dir_colors in your $HOME" as "into the directory .dir_colors"

Sorry for opening a non-bug report and thank you for the help.

Comment 3 Kamil Dudka 2022-08-01 12:31:55 UTC
No worries.  Any idea how to improve the wording to make it more obvious?

Comment 4 Dimitris 2022-08-01 13:08:25 UTC
How about:

# You can copy this file as the file ~/.dir_colors to override the system defaults

or maybe:

# You can override the system defaults by making a copy of this file as ~/.dir_colors

Something along those lines...

Comment 5 Kamil Dudka 2022-08-01 13:50:11 UTC
Thanks!  I have submitted a merge request to fix this: https://src.fedoraproject.org/rpms/coreutils/pull-request/9