You need to create a file called /etc/terminal-colors.d/fdisk.scheme
containing the colour scheme you desire (or copy it from another machine).
You may need to first create the /etc/terminal-colors.d
directory (I had to on my debian machine - I had no idea until now that fdisk
even had colour options...and now that I know, I don't want to know :-)
NOTE: Creating the file and the directory needs to be done as root (or with sudo
).
For example, for an absolutely hideous, unreadable colour scheme, you might try:
header 33;41
help-title 34;43
warn 47;30
welcome 42;34
This is documented in the fdisk
man page (search for the COLORS section near the bottom), and in the man page for terminal-colors.d
. The fdisk
man page has this to say about colours:
-L, --color[=when]
Colorize the output. The optional argument when
can be auto
, never
or always
. If the when
argument is omitted,
it defaults to auto
. The colors can be disabled; for the current built-in default see the --help
output. See
also the COLORS section.
NOTE: if colours are disabled by default, you may also need to sudo touch /etc/terminal-colors.d/fdisk.enable
.
and
COLORS
Implicit coloring can be disabled by an empty file /etc/terminal-colors.d/fdisk.disable
.
See terminal-colors.d(5)
for more details about colorization configuration. The logical color names supported by fdisk
are:
header The header of the output tables.
help-title The help section titles.
warn The warning messages.
welcome The welcome message.
terminal-colors.d
seems to be a generic, centralised location for enabling, disabling, and or specifying colour schemes for a variety of command-line tools. It's part of util-linux
and is used by all tools within that package. It may (or may not) have been adopted by other tools too.
I've never heard of it before today (not surprising, having garish colours on my terminal is not something that interests me) but it'll probably turn out to have been in existence for years.