From 952cd19005763cab8f95df45437c91cc7497f063 Mon Sep 17 00:00:00 2001 From: salad Date: Tue, 10 Nov 2020 19:20:56 +0100 Subject: ctrl+d fixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxedd --- src/c_init.c | 13 +++++++++++++ src/ret | Bin 67 -> 0 bytes 2 files changed, 13 insertions(+) delete mode 100644 src/ret diff --git a/src/c_init.c b/src/c_init.c index 0133f7b..1e55f7e 100644 --- a/src/c_init.c +++ b/src/c_init.c @@ -22,8 +22,13 @@ #include "c_keys.h" #include "c_input.h" #include "c_utils.h" +#include "b_exit.h" #include "s_struct.h" +#include "s_com.h" +#include "s_line.h" +#include "s_destroy.h" #include "m_prompt.h" +#include "m_loop.h" short c_set_term_raw(char mode) @@ -80,6 +85,14 @@ static short return (c_end_key(ft_strlen(line), tcaps->plen, tcaps)); else if ((*((unsigned int *)buf)) == CTRL_L) return (c_ctrl_l(line, tcaps, msh)); + else if ((*((unsigned int *)buf)) == CTRL_D && + line[0] == '\0') + { + c_set_term_raw(0); + write(1, "exit\n", 5); + exit(msh->ret); + return (1); + } else return (0); } diff --git a/src/ret b/src/ret deleted file mode 100644 index 42d8826..0000000 Binary files a/src/ret and /dev/null differ -- cgit v1.2.3