diff options
Diffstat (limited to 'terminal/terminal.c')
| -rw-r--r-- | terminal/terminal.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/terminal/terminal.c b/terminal/terminal.c index 7fc6f93..ccea64e 100644 --- a/terminal/terminal.c +++ b/terminal/terminal.c @@ -8,9 +8,6 @@ #include "kernel/kmalloc.h" #include "driver/screen.h" -#define SET_LFNL true -#define SET_BUFF false -#define SET_ECHO true typedef enum { @@ -238,6 +235,10 @@ terminal_tty terminal_init(term_out *screen,term_in *input) tty.data=kballoc(2); + tty.set_buff=true; + tty.set_lfnl=true; + tty.set_echo=true; + tty.command=kballoc(1); tty.command_l=0; @@ -262,9 +263,9 @@ terminal_tty terminal_init(term_out *screen,term_in *input) void terminal_kb(terminal_tty *tty, uint8_t c) { - if(SET_ECHO)terminal_put(tty,c); + if(tty->set_echo)terminal_put(tty,c); - if(SET_BUFF) + if(tty->set_buff) { tty->command[tty->command_l]=c; (tty->command_l)++; @@ -328,7 +329,7 @@ bool terminal_put(terminal_tty *tty, uint8_t c) set_char(tty,x,tty->y,' ',tty->fg,tty->bg); } tty->y++; - if(SET_LFNL)tty->x=0; + if(tty->set_lfnl)tty->x=0; } else // { |
