changement des couleurs du prompt - correction leger bug sur le backslash
This commit is contained in:
parent
1afdd9528b
commit
f63737a90c
3 changed files with 14 additions and 13 deletions
|
|
@ -6,7 +6,7 @@
|
||||||
/* By: gwojda <gwojda@student.42.fr> +#+ +:+ +#+ */
|
/* By: gwojda <gwojda@student.42.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2017/01/23 10:35:44 by gwojda #+# #+# */
|
/* Created: 2017/01/23 10:35:44 by gwojda #+# #+# */
|
||||||
/* Updated: 2017/02/04 18:16:37 by gwojda ### ########.fr */
|
/* Updated: 2017/02/05 17:44:07 by gwojda ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
|
|
@ -69,9 +69,9 @@
|
||||||
# define IS_QUOTES (1 << 0)
|
# define IS_QUOTES (1 << 0)
|
||||||
# define IS_BQUOTES (1 << 1)
|
# define IS_BQUOTES (1 << 1)
|
||||||
# define IS_DQUOTES (1 << 2)
|
# define IS_DQUOTES (1 << 2)
|
||||||
# define IS_ACCOLADE (1 << 3)
|
# define IS_BSLASH (1 << 3)
|
||||||
# define IS_BRACKET (1 << 4)
|
# define IS_ACCOLADE (1 << 4)
|
||||||
# define IS_BSLASH (1 << 5)
|
# define IS_BRACKET (1 << 5)
|
||||||
|
|
||||||
# define STR data_singleton()->line.input
|
# define STR data_singleton()->line.input
|
||||||
# define POS data_singleton()->line.pos
|
# define POS data_singleton()->line.pos
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
/* By: gwojda <gwojda@student.42.fr> +#+ +:+ +#+ */
|
/* By: gwojda <gwojda@student.42.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2017/01/26 13:32:52 by gwojda #+# #+# */
|
/* Created: 2017/01/26 13:32:52 by gwojda #+# #+# */
|
||||||
/* Updated: 2017/02/05 12:40:21 by gwojda ### ########.fr */
|
/* Updated: 2017/02/05 17:43:44 by gwojda ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
/* By: gwojda <gwojda@student.42.fr> +#+ +:+ +#+ */
|
/* By: gwojda <gwojda@student.42.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2016/12/13 13:51:33 by gwojda #+# #+# */
|
/* Created: 2016/12/13 13:51:33 by gwojda #+# #+# */
|
||||||
/* Updated: 2017/02/04 14:56:51 by gwojda ### ########.fr */
|
/* Updated: 2017/02/05 17:42:23 by gwojda ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
|
|
@ -23,13 +23,14 @@ static void ft_get_date(void)
|
||||||
|
|
||||||
t = time(NULL);
|
t = time(NULL);
|
||||||
tm = *localtime(&t);
|
tm = *localtime(&t);
|
||||||
ft_putstr("\033[22;32m");
|
ft_putstr("\x1b[38;5;242m");
|
||||||
|
// ft_putstr("\033[22;32m");
|
||||||
printf("%.2d:%.2d:%.2d ", tm.tm_hour, tm.tm_min, tm.tm_sec);
|
printf("%.2d:%.2d:%.2d ", tm.tm_hour, tm.tm_min, tm.tm_sec);
|
||||||
fflush(NULL);
|
fflush(NULL);
|
||||||
if (tm.tm_hour >= 8 && tm.tm_hour < 20)
|
if (tm.tm_hour >= 8 && tm.tm_hour < 20)
|
||||||
printf("\033[22;33m%C ", L'☀');
|
printf("\x1b[38;5;184m%C ", L'☀');
|
||||||
else
|
else
|
||||||
printf("\033[22;33m%C ", L'★');
|
printf("\x1b[38;5;184m%C ", L'★');
|
||||||
fflush(NULL);
|
fflush(NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -56,11 +57,11 @@ void ft_prompt(void)
|
||||||
|
|
||||||
do_job_notification();
|
do_job_notification();
|
||||||
ft_get_date();
|
ft_get_date();
|
||||||
ft_putstr("\033[22;36m");
|
ft_putstr("\x1b[38;5;254m");
|
||||||
ret = ft_currend_dir();
|
ret = ft_currend_dir();
|
||||||
ft_putstr("\033[22;33m");
|
ft_putstr("\x1b[38;5;184m");
|
||||||
printf(" %C", L'›');
|
printf(" %C ", L'›');
|
||||||
fflush(NULL);
|
fflush(NULL);
|
||||||
ft_putstr("\033[22;37m");
|
ft_putstr("\033[22;37m");
|
||||||
data_singleton()->line.prompt_size = ret + 12;
|
data_singleton()->line.prompt_size = ret + 13;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue