Commit Graph

33 Commits

Author SHA1 Message Date
Bananymous 8adc97980a Shell: rewrite the whole shell to use tokens instead of raw strings
tab completion is still running with raw strings and that has to be
fixed in the future.
2024-10-13 22:00:16 +03:00
Bananymous 3e68981b0b userspace: Remove start-gui from shell builtins and make it an alias
This makes way more sense :D
2024-10-07 18:01:33 +03:00
Bananymous 6fd76e8d1e Shell: Rewrite alias parsing to allow chained commands
You can now have "chained" commands in alias
e.g. `alias foo='echo hello && ls`
2024-10-07 18:01:33 +03:00
Bananymous dfcd15e7c4 Shell: Implement background processes with & 2024-10-07 18:01:33 +03:00
Bananymous 5bcfc9dd50 Shell: Always print prompt to new line
This is only done on non banan-os targets if terminal is detected to
support cursor position querying
2024-10-07 18:01:32 +03:00
Bananymous f67cad326a Shell: Don't crash when there are no tab completions available :D 2024-10-07 14:26:07 +03:00
Bananymous 9775e83374 Shell: Fix tab space escaping in tab completion 2024-10-07 04:19:36 +03:00
Bananymous 264d1798dc Shell: Clenup code and fix some bugs
Don't list tab completion multiple times, allow `clear` to work even
when ANSI CSI 3K is not supported, reset buffer index when cancelling
command with ctrl+c
2024-10-07 04:10:25 +03:00
Bananymous 1824988b9a Shell: Add support for simple aliases
Aliases do not support chained commands with pipes, &&, ... but this is
a good start.
2024-10-07 04:09:38 +03:00
Bananymous c54d9b3f60 Shell: Implement simple tab completion for commands and files 2024-10-07 01:44:44 +03:00
Bananymous 4f7828bab9 Shell: Allow escaping spaces in commands 2024-10-07 01:44:44 +03:00
Bananymous ae073a336d Shell: Move builtin commands to a hash map
This allows accessing builtin commands outside of `execute_builtin`
2024-10-07 01:44:44 +03:00
Bananymous 4f3c05851c Shell: Expand ~ to home if its at the start of non quoted argument 2024-10-06 01:38:43 +03:00
Bananymous 4b13055125 Shell: Make builtin exit command read exit value from argument
Shell used to unconditionally return with exit code of 0
2024-10-06 01:24:34 +03:00
Bananymous d542cd811d Shell: Add support for &&, || and ; 2024-10-06 01:24:24 +03:00
Bananymous f75cebac7e Shell: Mark all functions as static 2024-10-05 19:11:58 +03:00
Bananymous e302b6b635 Shell: Use sigaction instead of signal
This allows ctrl-c to work on linux :D
2024-10-05 19:07:59 +03:00
Bananymous f709e88994 Shell: Cleanup argument handling and exiting 2024-10-04 17:54:01 +03:00
Bananymous ab9a6d583b Userspace: Set SHELL environment variable in init instead of shell 2024-10-04 17:24:37 +03:00
Bananymous 26d6bf338e Shell: Ignore SIGTTOU and set pgroup from parent instead of child
This allows using the shell in linux!
2024-10-04 17:23:31 +03:00
Bananymous b6e040dfc2 Kernel/Shell: Fix backspace and delete key byte sequences 2024-10-04 04:14:47 +03:00
Bananymous 04ae53b6df Shell: Add back accidentally deleted `cd` and `time` builtins 2024-09-17 16:38:45 +03:00
Bananymous d68ad893f0 Kernel/Shell: Add support for delete key 2024-09-14 22:45:48 +03:00
Bananymous 4ca147699d Shell: use printf and putchar instead of fprintf and fputc 2024-09-14 22:37:09 +03:00
Bananymous abed41b8fa Shell: Remove builtin tests
Test should be programs in /bin instead
2024-09-14 22:28:33 +03:00
Bananymous 2604a55f80 Shell: Make ctrl+c start a new command 2024-09-14 22:27:32 +03:00
Bananymous 5f92807fdd userspace: Allow building without SSE
I had added changes that had broken compilation without sse support
2024-09-02 21:25:00 +03:00
Bananymous bec3e8654f Shell: Implement escaping quotes in quoted strings 2024-08-24 17:13:50 +03:00
Bananymous 1c67b5e812 Kernel: Fix wait syscall to report status of exited children 2024-08-09 16:52:35 +03:00
Bananymous 20d38ed28c LibC/Shell: Implement gethostname() and shell uses it for hostname 2024-07-31 23:53:55 +03:00
Bananymous 5b8fdbc82d LibC: Don't expose math.h in stdlib.h 2024-07-16 12:47:38 +03:00
Bananymous 442ea8a692 BAN: Remove Optional emplace constructor
This was kind breaking some initializations. Emplacing is still possible
through Optional::emplace
2024-07-14 01:53:50 +03:00
Bananymous 8ddab05ed3 BuildSystem: Cleanup userspace directory layout
userspace programs are now in userspace/programs
userspace tests are now in userspace/tests

This makes listing userspace projects much cleaner. Libraries were
already separated to their own directory, so other programs should also.
2024-07-03 09:18:02 +03:00