Readline: Get a new prompt on SIGINT

前端 未结 4 1287
暗喜
暗喜 2021-01-04 03:52

I\'ve got code similar to the following, using readline:

#include 
#include 
#include 
#include          


        
4条回答
  •  情书的邮戳
    2021-01-04 04:20

    Call rl_clear_signals().

    This will disable the signal handlers libreadline installed. The one that handles SIGINT is responsible for the observed behaviour of restoring the prompt.

    More details on how to manage readline()s signal handling can be read here.

提交回复
热议问题