signal: SIGQUIT prints ^\ to the terminal, and does not redisplay the prompt

This commit is contained in:
Khaïs COLIN 2025-04-04 17:06:40 +02:00
parent 10e8738336
commit ceee5f99d4
Signed by: logistic-bot
SSH key fingerprint: SHA256:RlpiqKeXpcPFZZ4y9Ou4xi2M8OhRJovIwDlbCaMsuAo

View file

@ -6,7 +6,7 @@
/* By: jguelen <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/02/20 10:26:05 by jguelen #+# #+# */
/* Updated: 2025/04/04 16:58:58 by khais ### ########.fr */
/* Updated: 2025/04/04 17:05:32 by khais ### ########.fr */
/* */
/* ************************************************************************** */
@ -29,11 +29,13 @@ int g_signum = 0;
*/
static void sig_interactive(int signum)
{
(void)signum;
rl_replace_line("", 0);
ft_printf("\n");
rl_on_new_line();
rl_redisplay();
if (signum == SIGINT)
{
rl_replace_line("", 0);
ft_printf("\n");
rl_on_new_line();
rl_redisplay();
}
}
void readline_reset(void)
@ -69,7 +71,6 @@ int set_interactive_mode_sig_handling(void)
return (-1);
if (sigaction(SIGINT, &sig_act, NULL) == -1)
return (-1);
sig_act.sa_handler = SIG_IGN;
if (sigaction(SIGQUIT, &sig_act, NULL) == -1)
return (-1);
return (0);