mirror of
https://github.com/subhobhai943/SUB-OS.git
synced 2026-10-25 16:52:29 +00:00
feat(gui): Make the desktop terminal run real commands
The GUI terminal recognised four hardcoded strings and answered everything else
with "Executed: '<cmd>'". It now dispatches to the same LazyBox applet table and
shell builtins the kernel TTY uses, so ls, free, uname, lspci, ktest, neofetch,
sort, cd and the rest all work, with cwd tracked across commands.
LazyBox reports through printk, so before running a command the terminal
installs a printk sink and streams the output into its own scrollback:
- ANSI SGR codes become per-line colours instead of being stripped.
- CP437 box-drawing and block characters fall back to ASCII, so the colour
swatch in neofetch renders as '#' rather than a row of '?'.
- 256 lines of scrollback, command history on Up/Down, PgUp/PgDn/Home/End.
- Applets that read the keyboard directly (nano, snake, sh, top) are refused
with a pointer to the TTY, since they would block the compositor.
The window's paint and event handlers moved out of gui_apps.c into
gui/gui_terminal.c, and gui_gfx.c now draws from the shared lib/font8x8.c table
rather than its own copy.
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01L5yKJT4Wo2cV3rfPrwY5MP
This commit is contained in:
1 parent
56a378b142
commit
eacba4f4d3
8 files changed
+543
-196
No files matched your search
+3
-2
@@ -10,6 +10,7 @@
|
||||
#include <gui/gui_cursor.h>
|
||||
#include <gui/gui_wm.h>
|
||||
#include <gui/gui_apps.h>
|
||||
#include <gui/gui_terminal.h>
|
||||
#include <gui/gui_apps_ext.h>
|
||||
#include <gui/gui_widgets.h>
|
||||
#include <gui/gui_icons.h>
|
||||
@@ -43,7 +44,7 @@ typedef struct {
|
||||
|
||||
// Launchers used by both the icon grid and the start menu.
|
||||
static const desktop_app_t g_apps[] = {
|
||||
{ "Terminal", GUI_ICON_TERMINAL, gui_app_terminal_launch, 30, 40, 440, 280 },
|
||||
{ "Terminal", GUI_ICON_TERMINAL, gui_app_terminal_launch, 30, 40, 560, 340 },
|
||||
{ "Files", GUI_ICON_FOLDER, gui_app_fileman_launch, 80, 70, 380, 240 },
|
||||
{ "Monitor", GUI_ICON_MONITOR, gui_app_sysmon_launch, 420, 40, 340, 240 },
|
||||
{ "Tasks", GUI_ICON_TASKS, gui_app_taskmgr_launch, 180, 60, 380, 300 },
|
||||
@@ -549,7 +550,7 @@ int gui_desktop_run(void) {
|
||||
|
||||
// Open a default session so the desktop is not empty on first boot.
|
||||
gui_app_sysmon_launch(430, 30, 340, 240);
|
||||
gui_app_terminal_launch(30, 40, 380, 260);
|
||||
gui_app_terminal_launch(30, 40, 560, 340);
|
||||
|
||||
// Discard anything the console left in the keyboard queue; a stale key
|
||||
// arriving on frame 0 would otherwise act as a desktop shortcut.
|
||||
|
||||
Reference in new issue
Block a user