heredoc ctrl+C

This commit is contained in:
2024-04-25 18:41:02 +02:00
parent 15f8e10829
commit 2af75c9497
6 changed files with 27 additions and 17 deletions

View File

@ -6,7 +6,7 @@
/* By: marde-vr <marde-vr@42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/03/22 14:31:13 by tomoron #+# #+# */
/* Updated: 2024/04/25 13:46:40 by tomoron ### ########.fr */
/* Updated: 2024/04/25 18:39:18 by tomoron ### ########.fr */
/* */
/* ************************************************************************** */
@ -37,18 +37,24 @@ void *here_doc_variables(int write, void *data)
void signal_handler_here_doc(int signum)
{
t_msh *msh;
t_msh *msh;
if (signum == SIGINT)
{
msh = here_doc_variables(0, 0);
close(msh->in_fd);
rl_on_new_line();
printf("\n");
if(msh->in_fd > 2)
close(msh->in_fd);
ft_exit(msh, 1);
}
}
int set_echoctl(int value)
{
printf("nope");
(void)value;
/*
struct termios t_p;
if (!isatty(1))
@ -64,6 +70,8 @@ int set_echoctl(int value)
if (tcsetattr(1, TCSANOW, &t_p))
return (1);
return (0);
*/
return(0);
}
void signal_handler_command(int signum)