mirror of
https://codeberg.org/la-chouette/minishell.git
synced 2025-12-05 23:18:08 +01:00
signal: SIGQUIT prints ^\ to the terminal, and does not redisplay the prompt
This commit is contained in:
parent
10e8738336
commit
ceee5f99d4
1 changed files with 8 additions and 7 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue