summaryrefslogtreecommitdiff
path: root/src/user/highway/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/user/highway/main.c')
-rw-r--r--src/user/highway/main.c31
1 files changed, 25 insertions, 6 deletions
diff --git a/src/user/highway/main.c b/src/user/highway/main.c
index 4599315..60d5a69 100644
--- a/src/user/highway/main.c
+++ b/src/user/highway/main.c
@@ -1,17 +1,36 @@
-#include <knob/user.h>
+#include <terminal/terminal.h>
+#include <terminal/readline.h>
+
+#include <libfont/fonts.h>
+
+#include <knob/format.h>
+#include <knob/heap.h>
#include <knob/task.h>
+
#include "cmds.h"
#include "line.h"
+#define FONT_NAME "berry"
+
void main(const char *arg) {
+ struct font_info *f = get_font(FONT_NAME);
+
+ if (!f)
+ return;
+
+ active_term = make_term(f, 50, 18);
+ if (!active_term)
+ return;
+
source(*arg ? arg : "user/default.rc");
+ ensure_color();
+
+ term_add_sz("Portland Highway\nType \"help\" for help.\n");
+ paint_term();
+
char cmd_buf[128];
- yield_task();
- struct history *cmd_hs = new_history(128);
- tell_user_sz("Portland Highway\nType \"help\" for help.\n");
while (1) {
- tell_user_sz("\n> ");
- ask_user_line_sz_with_history(cmd_buf, 127, cmd_hs);
+ read_line(cmd_buf, 127, "> ");
run_line(cmd_buf);
}
} \ No newline at end of file