readline display

This commit is contained in:
Loic Deridder
2025-02-14 11:00:53 +01:00
parent 459862d0a5
commit daefee35e0
3 changed files with 12 additions and 7 deletions

View File

@@ -61,11 +61,11 @@ void handle_sigint(int sig);
void handle_sigquit(int sig); void handle_sigquit(int sig);
char *powerline(t_msh *msh); char *powerline(t_msh *msh);
# define POW1 "\033[1;38;2;21;22;26;48;2;92;106;178m" # define POW1 "\001\033[1;38;2;21;22;26;48;2;92;106;178m\002"
# define POW2 "\033[1;38;2;92;106;178;48;2;54;54;54m" # define POW2 "\001\033[1;38;2;92;106;178;48;2;54;54;54m\002"
# define POW3 "\033[1;38;2;54;54;54;48;2;39;39;39m" # define POW3 "\001\033[1;38;2;54;54;54;48;2;39;39;39m\002"
# define POW4 "\033[0;38;2;204;205;209;48;2;39;39;39m" # define POW4 "\001\033[0;38;2;204;205;209;48;2;39;39;39m\002"
# define POW5 "\033[1;38;2;39;39;39m" # define POW5 "\001\033[1;38;2;39;39;39m\002"
# define SEP "\033[38;2;64;64;64m" # define SEP "\001\033[38;2;64;64;64m\002"
#endif #endif

View File

@@ -13,7 +13,7 @@
#ifndef COLORS_H #ifndef COLORS_H
# define COLORS_H # define COLORS_H
# define RESET "\033[0m" # define RESET "\001\033[0m\002"
# define BLACK "\033[0;30m" # define BLACK "\033[0;30m"
# define RED "\033[0;31m" # define RED "\033[0;31m"

View File

@@ -16,6 +16,11 @@ int handle_file(t_ast_n *node, int check, int i)
{ {
int fd; int fd;
if (check == 1 && access(node->files[i], F_OK))
{
ft_fprintf(2, "%s: %s\n", node->files[i], "No such file or directory");
return (1);
}
if (check == 1) if (check == 1)
fd = open(node->files[i], O_RDONLY); fd = open(node->files[i], O_RDONLY);
else if (check == 2) else if (check == 2)