From b97f268578dc8db48d001a7027f13e97687ad821 Mon Sep 17 00:00:00 2001 From: gwojda Date: Tue, 14 Mar 2017 12:16:51 +0100 Subject: [PATCH] oublies d'un fichier --- 42sh/src/line-editing/resize.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 42sh/src/line-editing/resize.c 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()); + } +}