2023-09-14 20:51:19 +00:00
|
|
|
#include "TerminalWidget.h"
|
|
|
|
#include <os/ArgumentParser.h>
|
|
|
|
#include <ui/App.h>
|
2023-09-16 09:48:11 +00:00
|
|
|
#include <unistd.h>
|
2023-09-14 20:51:19 +00:00
|
|
|
|
2024-02-01 20:15:31 +00:00
|
|
|
Result<int> luna_main(int, char**)
|
2023-09-14 20:51:19 +00:00
|
|
|
{
|
|
|
|
ui::App app;
|
2024-02-01 20:15:31 +00:00
|
|
|
TRY(app.init());
|
2023-09-14 20:51:19 +00:00
|
|
|
|
2023-09-16 09:48:11 +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");
|
|
|
|
|
|
|
|
TerminalWidget terminal;
|
|
|
|
window->set_main_widget(terminal);
|
|
|
|
|
2023-09-16 09:48:11 +00:00
|
|
|
char* args[] = { "/bin/sh", nullptr };
|
2023-09-14 20:51:19 +00:00
|
|
|
TRY(terminal.init(args));
|
|
|
|
|
|
|
|
window->draw();
|
|
|
|
|
2024-01-08 18:04:04 +00:00
|
|
|
return app.run();
|
2023-09-14 20:51:19 +00:00
|
|
|
}
|