summaryrefslogtreecommitdiffstats
path: root/src/c_init.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/c_init.c')
-rw-r--r--src/c_init.c13
1 files changed, 13 insertions, 0 deletions
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);
}