当 nCurses 应用程序来自后台时内容无效
Invalid content when nCurses app comes from background
我在将 nCurses 应用程序放入 background/foreground 时观察到奇怪的行为。几次后,我的 window 显示无效内容。我怀疑在向我的应用程序发送 SIGSTOP
/SIGCONT
信号时,我需要处理这些信号并刷新 window,但我找不到任何关于它的注释。从后台返回时,nCurses 是否有某种刷新 window 的方法?或者原因可能不同?
ncurses 确实有一个 handler for SIGTSTP
, which it sets up in initscr
— if it is in the default state:
SIGTSTP
This handles the stop signal, used in job control. When resuming
the process, this implementation discards pending input with
flushinput (see curs_util(3x)), and repaints the screen assuming
that it has been completely altered. It also updates the saved
terminal modes with def_shell_mode (see curs_kernel(3x))
我在将 nCurses 应用程序放入 background/foreground 时观察到奇怪的行为。几次后,我的 window 显示无效内容。我怀疑在向我的应用程序发送 SIGSTOP
/SIGCONT
信号时,我需要处理这些信号并刷新 window,但我找不到任何关于它的注释。从后台返回时,nCurses 是否有某种刷新 window 的方法?或者原因可能不同?
ncurses 确实有一个 handler for SIGTSTP
, which it sets up in initscr
— if it is in the default state:
SIGTSTP
This handles the stop signal, used in job control. When resuming the process, this implementation discards pending input with flushinput (see curs_util(3x)), and repaints the screen assuming that it has been completely altered. It also updates the saved terminal modes with def_shell_mode (see curs_kernel(3x))