Luna/terminal/main.cpp

25 lines
530 B
C++
Raw Normal View History

2023-09-14 20:51:19 +00:00
#include "TerminalWidget.h"
#include <os/ArgumentParser.h>
#include <ui/App.h>
#include <unistd.h>
2023-09-14 20:51:19 +00:00
Result<int> luna_main(int argc, char** argv)
{
ui::App app;
TRY(app.init(argc, argv));
auto* window = TRY(ui::Window::create(ui::Rect { 150, 150, 640, 400 }));
2023-09-14 20:51:19 +00:00
app.set_main_window(window);
window->set_title("Terminal");
TerminalWidget terminal;
window->set_main_widget(terminal);
char* args[] = { "/bin/sh", nullptr };
2023-09-14 20:51:19 +00:00
TRY(terminal.init(args));
window->draw();
return app.run();
2023-09-14 20:51:19 +00:00
}