diff options
author | Phaedrus Leeds <mwleeds@protonmail.com> | 2021-11-01 17:43:31 -0700 |
---|---|---|
committer | Phaedrus Leeds <mwl458@gmail.com> | 2022-01-04 10:44:37 -0800 |
commit | 62b414021261bc2b718d0f943e25d77fe340cef5 (patch) | |
tree | 37b5d1b2298709486535e8b1b65c353b98b1ce46 | |
parent | 36b03000a8f4e466c39c16e7eb19a9b90bc03955 (diff) | |
download | flatpak-62b414021261bc2b718d0f943e25d77fe340cef5.tar.gz |
app: Don't use carriage return for non-fancy output
flatpak_fancy_output() determines whether the output we write is
intended for e.g. a tty or e.g. a log file, the latter being "not
fancy". Currently we write carriage return characters in the not fancy
case, but change that to new lines, which are interpreted correctly by
editors such as vim (whereas a carriage return shows up as ^M since it
is not the correct newline character on Unixy operating systems).
(cherry picked from commit 86d6918a1186467fb4e26408ec1bb947dcf7ba28)
-rw-r--r-- | app/flatpak-cli-transaction.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/app/flatpak-cli-transaction.c b/app/flatpak-cli-transaction.c index a19a6a41..788be097 100644 --- a/app/flatpak-cli-transaction.c +++ b/app/flatpak-cli-transaction.c @@ -455,7 +455,7 @@ new_operation (FlatpakTransaction *transaction, redraw (self); } else - g_print ("\r%-*s", self->table_width, text); + g_print ("\n%-*s", self->table_width, text); g_free (self->progress_msg); self->progress_msg = g_steal_pointer (&text); @@ -509,7 +509,7 @@ operation_error (FlatpakTransaction *transaction, redraw (self); } else - g_print ("\r%-*s\n", self->table_width, msg); /* override progress, and go to next line */ + g_print ("\n%-*s\n", self->table_width, msg); /* override progress, and go to next line */ return TRUE; } @@ -548,7 +548,7 @@ operation_error (FlatpakTransaction *transaction, redraw (self); } else - g_printerr ("\r%-*s\n", self->table_width, text); + g_printerr ("\n%-*s\n", self->table_width, text); if (!non_fatal && self->stop_on_first_error) return FALSE; @@ -1052,7 +1052,7 @@ message_handler (const gchar *log_domain, redraw (self); } else - g_print ("\r%-*s\n", self->table_width, text); + g_print ("\n%-*s\n", self->table_width, text); } static gboolean @@ -1414,7 +1414,7 @@ flatpak_cli_transaction_run (FlatpakTransaction *transaction, redraw (self); } else - g_print ("\r%-*s", self->table_width, text); + g_print ("\n%-*s", self->table_width, text); g_print ("\n"); } |