diff --git a/42sh/src/line-editing/resize.c b/42sh/src/line-editing/resize.c new file mode 100644 index 00000000..8963c96d --- /dev/null +++ b/42sh/src/line-editing/resize.c @@ -0,0 +1,31 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* resize.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: gwojda +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2017/03/14 10:56:08 by gwojda #+# #+# */ +/* Updated: 2017/03/14 12:00:29 by gwojda ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "minishell.h" +int c_dispatcher(t_data *s); + +void sigwinch_resize(int sig) +{ + size_t pos_tmp; + + pos_tmp = 0; + (void)sig; + if (data_singleton()->comp) + { + c_term_resize(data_singleton()->comp); + ft_puttermcaps("cl"); + data_singleton()->line.is_prompt ? ft_prompt() : ft_putstr("> "); + ft_putall_current_str(STR, &pos_tmp); + ft_putnc('\b', pos_tmp - POS); + c_dispatcher(data_singleton()); + } +}