diff options
author | salad <fmoenne-@student.le-101.fr> | 2020-11-06 20:17:34 +0100 |
---|---|---|
committer | salad <fmoenne-@student.le-101.fr> | 2020-11-06 20:17:34 +0100 |
commit | 87a70e527eca58cad87c14fd2a8595b8bce85e25 (patch) | |
tree | 9bbb931a9bdd16d93f6546e1e7f254ba3c3db221 /src/c_init.c | |
parent | C-c arrows (diff) | |
download | 42-minishell-87a70e527eca58cad87c14fd2a8595b8bce85e25.tar.gz 42-minishell-87a70e527eca58cad87c14fd2a8595b8bce85e25.tar.bz2 42-minishell-87a70e527eca58cad87c14fd2a8595b8bce85e25.tar.xz 42-minishell-87a70e527eca58cad87c14fd2a8595b8bce85e25.tar.zst 42-minishell-87a70e527eca58cad87c14fd2a8595b8bce85e25.zip |
major changes to ctrlc + c, no norm for now
Diffstat (limited to 'src/c_init.c')
-rw-r--r-- | src/c_init.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/c_init.c b/src/c_init.c index d80b9ea..314baad 100644 --- a/src/c_init.c +++ b/src/c_init.c @@ -24,6 +24,8 @@ #include "s_struct.h" #include "m_prompt.h" +t_msh *c_get_struct(int mode, t_msh *msh); + short c_set_term_raw(char mode) { @@ -79,11 +81,6 @@ 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_C) - { - msh->ret = 130; - return (1); - } else return (0); } @@ -110,6 +107,10 @@ static char } c_redraw_line(line, tcaps, msh); } + else if ((*((unsigned int *)buf)) == CTRL_C) + { + return (c_ctrl_c(&line, buf, msh)); + } else { c_read_cap(buf, line, tcaps, msh); @@ -128,7 +129,7 @@ short m_prompt_psx(psx, msh); ft_bzero(nread, 4); tcaps.plen = (unsigned int)m_plen(msh->ps[psx - 1]); - tcaps.plen += (psx != 1); + c_get_struct(1, msh); if (!(c_get_win_size(&tcaps.ws))) return (-1); while (!(ft_strchr(nread, '\n'))) |