diff options
Diffstat (limited to '')
-rw-r--r-- | src/c_init.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/c_init.c b/src/c_init.c index 8870b27..a196708 100644 --- a/src/c_init.c +++ b/src/c_init.c @@ -14,6 +14,7 @@ #include <stdlib.h> #include <term.h> #include <libft.h> +#include <signal.h> #include "c_init.h" #include "c_input.h" @@ -82,9 +83,9 @@ int16_t else { if (ft_strncmp(buf, tcaps->KL, 4) == 0) - return (c_key_left(ft_strlen(line), tcaps)); + return (c_key_left(ft_strlen(line), ft_strlen(msh->ps[0]), tcaps)); else if (ft_strncmp(buf, tcaps->KR, 4) == 0) - return (c_key_right(ft_strlen(line), tcaps)); + return (c_key_right(ft_strlen(line), ft_strlen(msh->ps[0]), tcaps)); else if (ft_strncmp(buf, tcaps->HM, 4) == 0) return (c_home_key(tcaps)); else if (ft_strncmp(buf, tcaps->ND, 4) == 0) @@ -94,7 +95,11 @@ int16_t else if (ft_strncmp(buf, tcaps->CL, 4) == 0) return (c_ctrl_l(line, tcaps, msh)); else if (ft_strncmp(buf, tgetstr("kb", NULL), ft_strlen(tgetstr("kb", NULL))) == 0) - return (c_back_slash(&line, tcaps)); + { + c_back_slash(&line, tcaps); + c_redraw_line(line, tcaps, msh); + return (1); + } else if (buf[0] == '\n') { c_new_line(ft_strdup(line), msh, tcaps); @@ -123,6 +128,7 @@ int16_t c_get_struct(1, &tcaps); c_init_keys(&tcaps); m_prompt_psx(1, msh); + signal(SIGINT, SIG_IGN); if (!(c_get_win_size(&tcaps.ws))) return (-1); while (1) |