summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhaedrus Leeds <mwleeds@protonmail.com>2021-11-01 17:43:31 -0700
committerAlexander Larsson <alexander.larsson@gmail.com>2021-11-15 09:57:09 +0100
commit86d6918a1186467fb4e26408ec1bb947dcf7ba28 (patch)
tree16cc5f55d764a1bfaa4b138c33140d409d12bc73
parent20fd994c5c8bda4ea9f2b56cf3a83c15057a547f (diff)
downloadflatpak-86d6918a1186467fb4e26408ec1bb947dcf7ba28.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).
-rw-r--r--app/flatpak-cli-transaction.c10
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");
}