From 3feb8a2f8b82a35df1f4c7e6f643bf8eaabb6f60 Mon Sep 17 00:00:00 2001 From: salad Date: Mon, 7 Dec 2020 15:36:45 +0100 Subject: WIP --- src/c_ctrls.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/c_ctrls.c') diff --git a/src/c_ctrls.c b/src/c_ctrls.c index f841705..dcb51de 100644 --- a/src/c_ctrls.c +++ b/src/c_ctrls.c @@ -34,7 +34,7 @@ short c_ctrl_l(char *line, t_caps *tcaps, t_msh *msh) { tputs(tgetstr("cl", NULL), 1, ft_putchar); m_prompt_psx(1, msh); - c_redraw_line(line, tcaps, msh); + c_redraw_line(line, tcaps); return (1); } -- cgit v1.2.3 From 45d3ad71ea69e18b27eb3fa202429e0b73a3826b Mon Sep 17 00:00:00 2001 From: salad Date: Tue, 15 Dec 2020 17:02:34 +0100 Subject: norm and fix ctrl_c to fit c_gnl rewrite --- src/c_ctrls.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/c_ctrls.c') diff --git a/src/c_ctrls.c b/src/c_ctrls.c index dcb51de..9431f72 100644 --- a/src/c_ctrls.c +++ b/src/c_ctrls.c @@ -44,7 +44,8 @@ char *c_ctrl_c(char **line, char *buf, t_msh *msh) buf[0] = '\n'; write(1, "\n", 1); ft_memdel((void**)line); - return (ft_strdup("\0")); + *line = ft_strdup("\0"); + return (NULL); } void c_signal_int(int signo) -- cgit v1.2.3 From 658e858cee47e54b8e3023f50d4f972a9ac55f0f Mon Sep 17 00:00:00 2001 From: salad Date: Tue, 15 Dec 2020 17:15:58 +0100 Subject: norm tobecontinued --- src/c_ctrls.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/c_ctrls.c') diff --git a/src/c_ctrls.c b/src/c_ctrls.c index 9431f72..58b4517 100644 --- a/src/c_ctrls.c +++ b/src/c_ctrls.c @@ -11,6 +11,7 @@ /* ************************************************************************** */ #include +#include #include #include #include @@ -18,6 +19,9 @@ #include "c_ctrls.h" #include "c_utils.h" #include "m_prompt.h" +#include "m_loop.h" +#include "s_destroy.h" +#include "u_utils.h" t_msh *c_get_msh(int mode, t_msh *src) { @@ -30,6 +34,20 @@ t_msh *c_get_msh(int mode, t_msh *src) return (msh); } +short c_ctrl_d(t_msh *msh) +{ + int tmp; + + c_set_term_raw(0); + write(STDERR_FILENO, "exit\n", 5); + u_eof_fd(msh->fd); + m_dump_hist(msh->curr_hist_ptr, msh); + tmp = msh->ret; + s_destroy(msh); + exit(tmp); + return (1); +} + short c_ctrl_l(char *line, t_caps *tcaps, t_msh *msh) { tputs(tgetstr("cl", NULL), 1, ft_putchar); -- cgit v1.2.3 From 711bc9edbd9646900fc7e00e7b3457c2070ac31f Mon Sep 17 00:00:00 2001 From: salad Date: Wed, 16 Dec 2020 13:10:11 +0100 Subject: qwe --- src/c_ctrls.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) (limited to 'src/c_ctrls.c') diff --git a/src/c_ctrls.c b/src/c_ctrls.c index 58b4517..3dca13e 100644 --- a/src/c_ctrls.c +++ b/src/c_ctrls.c @@ -17,23 +17,13 @@ #include #include "c_ctrls.h" +#include "c_keys_next.h" #include "c_utils.h" #include "m_prompt.h" #include "m_loop.h" #include "s_destroy.h" #include "u_utils.h" -t_msh *c_get_msh(int mode, t_msh *src) -{ - static t_msh *msh; - - if (mode == 1) - { - msh = src; - } - return (msh); -} - short c_ctrl_d(t_msh *msh) { int tmp; -- cgit v1.2.3 From e3958afc911de2c628aa336893123ac871da3817 Mon Sep 17 00:00:00 2001 From: salad Date: Wed, 16 Dec 2020 13:13:50 +0100 Subject: c_keys_next is now c_utils_next --- src/c_ctrls.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/c_ctrls.c') diff --git a/src/c_ctrls.c b/src/c_ctrls.c index 3dca13e..0bea322 100644 --- a/src/c_ctrls.c +++ b/src/c_ctrls.c @@ -17,7 +17,7 @@ #include #include "c_ctrls.h" -#include "c_keys_next.h" +#include "c_utils_next.h" #include "c_utils.h" #include "m_prompt.h" #include "m_loop.h" -- cgit v1.2.3 From f6cc429d6152f330de5d4aac36fea9810f9f47de Mon Sep 17 00:00:00 2001 From: salad Date: Fri, 18 Dec 2020 14:36:31 +0100 Subject: mergethis --- src/c_ctrls.c | 1 - 1 file changed, 1 deletion(-) (limited to 'src/c_ctrls.c') diff --git a/src/c_ctrls.c b/src/c_ctrls.c index 0bea322..af0528e 100644 --- a/src/c_ctrls.c +++ b/src/c_ctrls.c @@ -66,7 +66,6 @@ void c_signal_int(int signo) write(1, "\n", 1); msh = c_get_msh(0, msh); msh->sig = 130; - ioctl(1, TIOCSTI, "\002"); } void c_signal_ign(int signo) -- cgit v1.2.3