30 lines
655 B
C++
30 lines
655 B
C++
|
#include "TerminalWidget.h"
|
||
|
#include <os/ArgumentParser.h>
|
||
|
#include <ui/App.h>
|
||
|
|
||
|
Result<int> luna_main(int argc, char** argv)
|
||
|
{
|
||
|
ui::App app;
|
||
|
TRY(app.init(argc, argv));
|
||
|
app.set_nonblocking();
|
||
|
|
||
|
auto* window = TRY(ui::Window::create(ui::Rect { 150, 150, 500, 300 }));
|
||
|
app.set_main_window(window);
|
||
|
window->set_background(ui::BLACK);
|
||
|
window->set_title("Terminal");
|
||
|
|
||
|
TerminalWidget terminal;
|
||
|
window->set_main_widget(terminal);
|
||
|
|
||
|
char* args[] = { "/bin/sh", "-i", nullptr };
|
||
|
TRY(terminal.init(args));
|
||
|
|
||
|
window->draw();
|
||
|
|
||
|
while (app.process_events()) TRY(terminal.process());
|
||
|
|
||
|
terminal.quit();
|
||
|
|
||
|
return 0;
|
||
|
}
|