suspension: don't try to show the cursor position when going to sleep

As the statusbar() function will write the position directly to the
terminal when not in curses mode, the final part of this position
message will seem to be after the prompt when exiting from nano.

The cursor position will get written correctly to the status bar
anyway, because returning from suspension enters a fake key into
the keyboard buffer, and this key elicits an update of the display.

This fixes https://savannah.gnu.org/bugs/?54639.
Reported-by: Lauri Kasanen <cand@gmx.com>

Bug existed since version 2.4.2, commit 75d64e67.
master
Benno Schulenberg 2018-09-12 16:04:11 +02:00
parent fe3a72ce3e
commit eaeafe29ca
1 changed files with 3 additions and 0 deletions

View File

@ -1263,6 +1263,9 @@ RETSIGTYPE do_suspend(int signal)
/* Restore the old terminal settings. */
tcsetattr(0, TCSANOW, &oldterm);
/* The suspend keystroke must not elicit cursor-position display. */
suppress_cursorpos=TRUE;
#ifdef SIGSTOP
/* Do what mutt does: send ourselves a SIGSTOP. */
kill(0, SIGSTOP);