diff options
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'))) |