mirror of
https://codeberg.org/la-chouette/minishell.git
synced 2025-12-06 07:28:09 +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> +#+ +:+ +#+ */
|
/* By: jguelen <marvin@42.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2025/02/20 10:26:05 by jguelen #+# #+# */
|
/* 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)
|
static void sig_interactive(int signum)
|
||||||
{
|
{
|
||||||
(void)signum;
|
if (signum == SIGINT)
|
||||||
rl_replace_line("", 0);
|
{
|
||||||
ft_printf("\n");
|
rl_replace_line("", 0);
|
||||||
rl_on_new_line();
|
ft_printf("\n");
|
||||||
rl_redisplay();
|
rl_on_new_line();
|
||||||
|
rl_redisplay();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void readline_reset(void)
|
void readline_reset(void)
|
||||||
|
|
@ -69,7 +71,6 @@ int set_interactive_mode_sig_handling(void)
|
||||||
return (-1);
|
return (-1);
|
||||||
if (sigaction(SIGINT, &sig_act, NULL) == -1)
|
if (sigaction(SIGINT, &sig_act, NULL) == -1)
|
||||||
return (-1);
|
return (-1);
|
||||||
sig_act.sa_handler = SIG_IGN;
|
|
||||||
if (sigaction(SIGQUIT, &sig_act, NULL) == -1)
|
if (sigaction(SIGQUIT, &sig_act, NULL) == -1)
|
||||||
return (-1);
|
return (-1);
|
||||||
return (0);
|
return (0);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue