]> git.sur5r.net Git - i3/i3status/commitdiff
Bugfix: In term-output, clear line before drawing new one
authorAxel Wagner <mail@merovius.de>
Tue, 11 Jun 2013 14:08:14 +0000 (16:08 +0200)
committerMichael Stapelberg <michael@stapelberg.de>
Tue, 11 Jun 2013 21:50:29 +0000 (23:50 +0200)
If we don't do this, the output of i3status will remain on the terminal,
which is really ugly if the statusline becomes shorter after a while
(for example a connection get's lost), because there will be garbage.

i3status.c

index c6973f7d8246a9df6d2843a65d632df1b116b6b5..ded5799279472d902be652b4a10f5d4d3b9e8149 100644 (file)
@@ -442,8 +442,8 @@ int main(int argc, char *argv[]) {
                 if (output_format == O_I3BAR)
                         yajl_gen_array_open(json_gen);
                 else if (output_format == O_TERM)
-                        /* Restore the cursor-position */
-                        printf("\033[u");
+                        /* Restore the cursor-position, clear line */
+                        printf("\033[u\033[K");
                 for (j = 0; j < cfg_size(cfg, "order"); j++) {
                         if (j > 0)
                                 print_seperator();