libnbd/0001-info-Use-magenta-for-export-headings-instead-of-blac.patch
Richard W.M. Jones 3064c5a572 Rebase to libnbd 1.22.1
resolves: RHEL-78831
Fix nbdinfo with dark theme
resolves: RHEL-7119
2025-03-10 16:01:09 +00:00

74 lines
2.5 KiB
Diff

From 7e75a5666bf4078030a7334def14c67c2eeab1f6 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Mon, 10 Mar 2025 15:18:06 +0000
Subject: [PATCH] info: Use magenta for export headings, instead of black
Use of black foreground text makes the text invisible when using a
dark theme. Use a magenta colour instead which works on both light
and dark background.
Reported-by: Ming Xie
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2221199
Fixes: https://issues.redhat.com/browse/RHEL-7119
---
info/main.c | 2 --
info/show.c | 6 ++----
2 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/info/main.c b/info/main.c
index 8aa6cb74..1ee9e329 100644
--- a/info/main.c
+++ b/info/main.c
@@ -358,7 +358,6 @@ main (int argc, char *argv[])
if (!json_output) {
if (protocol) {
- ansi_colour (ANSI_FG_GREY, fp);
fprintf (fp, "protocol: %s", protocol);
if (tls_negotiated >= 0)
fprintf (fp, " %s TLS", tls_negotiated ? "with" : "without");
@@ -367,7 +366,6 @@ main (int argc, char *argv[])
eh_negotiated ? "extended" :
sr_negotiated ? "structured" : "simple");
fprintf (fp, "\n");
- ansi_restore (fp);
}
}
else {
diff --git a/info/show.c b/info/show.c
index 1596eb77..4886dad5 100644
--- a/info/show.c
+++ b/info/show.c
@@ -131,7 +131,7 @@ show_one_export (struct nbd_handle *nbd, const char *desc,
content = get_content (nbd, size);
if (!json_output) {
- ansi_colour (ANSI_FG_BOLD_BLACK, fp);
+ ansi_colour (ANSI_FG_BRIGHT_MAGENTA, fp);
fprintf (fp, "export=");
/* Might as well use the JSON function to get an escaped string here ... */
print_json_string (export_name);
@@ -148,10 +148,9 @@ show_one_export (struct nbd_handle *nbd, const char *desc,
fprintf (fp, "\texport-size: %s\n", size_str);
if (content)
fprintf (fp, "\tcontent: %s\n", content);
+ ansi_restore (fp);
if (uri)
fprintf (fp, "\turi: %s\n", uri);
- ansi_restore (fp);
- ansi_colour (ANSI_FG_GREY, fp);
if (show_context) {
fprintf (fp, "\tcontexts:\n");
for (i = 0; i < contexts.len; ++i)
@@ -160,7 +159,6 @@ show_one_export (struct nbd_handle *nbd, const char *desc,
if (is_rotational >= 0)
fprintf (fp, "\t%s: %s\n", "is_rotational",
is_rotational ? "true" : "false");
- ansi_restore (fp);
if (is_read_only >= 0)
fprintf (fp, "\t%s: %s\n", "is_read_only",
is_read_only ? "true" : "false");
--
2.47.1