debut signal

This commit is contained in:
2024-03-22 20:12:25 +01:00
parent 2718546387
commit 7b6c75b5c3
8 changed files with 59 additions and 14 deletions

35
srcs/signal_handler.c Normal file
View File

@ -0,0 +1,35 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* signal_handler.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: tomoron <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/03/22 14:31:13 by tomoron #+# #+# */
/* Updated: 2024/03/22 19:53:02 by tomoron ### ########.fr */
/* */
/* ************************************************************************** */
#include "minishell.h"
void signal_handler_interactive(int signum)
{
if(signum == 2)
{
g_return_code = 130;
ft_putstr_fd("\n", 1);
rl_replace_line("", 0);
rl_on_new_line();
rl_redisplay();
}
if(signum == 3)
{
rl_redisplay();
ft_putstr_fd("filsdeup", 1);
}
}
void signal_handler_command(int signum)
{
(void)signum;
}