Luna/terminal/main.cpp

22 lines
494 B
C++
Raw Permalink 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, char**)
2023-09-14 20:51:19 +00:00
{
ui::App app;
TRY(app.init());
2023-09-14 20:51:19 +00:00
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");
auto* terminal = TRY(window->create_main_widget<TerminalWidget>());
2023-09-14 20:51:19 +00:00
char* args[] = { "/bin/sh", nullptr };
TRY(terminal->init(args));
2023-09-14 20:51:19 +00:00
return app.run();
2023-09-14 20:51:19 +00:00
}