summaryrefslogtreecommitdiffstats
path: root/osdep/terminal-unix.c
diff options
context:
space:
mode:
authorGuido Cella <guido@guidocella.xyz>2023-12-15 17:02:18 +0100
committerDudemanguy <random342@airmail.cc>2023-12-18 15:03:40 +0000
commit17be6e1990a92e9b43f5f49cca9c4dd3da24a1e8 (patch)
treebc2b4ed9013e614e4b2c2657edb96df25b1a202d /osdep/terminal-unix.c
parentb563b2aed0aaca7a51ffe40e0e923c00fd77de46 (diff)
downloadmpv-17be6e1990a92e9b43f5f49cca9c4dd3da24a1e8.tar.bz2
mpv-17be6e1990a92e9b43f5f49cca9c4dd3da24a1e8.tar.xz
terminal-unix: enable the cursor after ctrl+z
24270b8587 disabled the cursor while mpv is running, but if you send mpv to the background, it is not re-enabled until you run bg, and not even after that if mpv is paused. Fix this by enabling the cursor from the SIGTSTP handler.
Diffstat (limited to 'osdep/terminal-unix.c')
-rw-r--r--osdep/terminal-unix.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/osdep/terminal-unix.c b/osdep/terminal-unix.c
index d5b8fe36b1..b777104d6b 100644
--- a/osdep/terminal-unix.c
+++ b/osdep/terminal-unix.c
@@ -358,6 +358,8 @@ static void stop_sighandler(int signum)
{
int saved_errno = errno;
(void)write(stop_cont_pipe[1], &(char){PIPE_STOP}, 1);
+ (void)write(STDERR_FILENO, TERM_ESC_RESTORE_CURSOR,
+ sizeof(TERM_ESC_RESTORE_CURSOR) - 1);
errno = saved_errno;
// note: for this signal, we use SA_RESETHAND but do NOT mask signals