]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
cfdisk: remove unnecessary cursor repositioning on exit
authorKarel Zak <kzak@redhat.com>
Tue, 28 Apr 2026 13:04:09 +0000 (15:04 +0200)
committerKarel Zak <kzak@redhat.com>
Tue, 28 Apr 2026 13:04:09 +0000 (15:04 +0200)
Remove the mvcur() call that moved the cursor to the bottom of the
terminal before endwin(). This pattern was inherited from the original
cfdisk (util-linux 2.2, 1996) and is unnecessary on modern terminals
where endwin() properly restores the terminal state.

The old behavior created extra blank lines between the previous shell
prompt and the new one after exiting cfdisk.

Addresses: https://github.com/util-linux/util-linux/discussions/4259
Signed-off-by: Karel Zak <kzak@redhat.com>
disk-utils/cfdisk.c

index 13cbadf1b055cc690ca5e9245e4fa83771728d6c..023f28161c9bf8180b7c04e8727131d453faa91c 100644 (file)
@@ -652,16 +652,9 @@ static int ui_end(void)
        if (!ui_enabled)
                return -EINVAL;
 
-#if defined(HAVE_SLCURSES_H) || defined(HAVE_SLANG_SLCURSES_H)
-       SLsmg_gotorc(ui_lines - 1, 0);
-       SLsmg_refresh();
-#else
-       mvcur(0, ui_cols - 1, ui_lines-1, 0);
-#endif
        curs_set(1);
        nl();
        endwin();
-       printf("\n");
        ui_enabled = 0;
        return 0;
 }