Commit graph

23 commits

Author SHA1 Message Date
2dd20b21bc feat(redir): fieldsplit redir target, and handle ambiguous redirects 2025-04-24 12:44:33 +02:00
2ae001e00b fix(exec/redirections): did not correctly restore fds when executing builtins
This caused redirections to keep stdout redirected to the outfile, which caused
problems with displaying the prmpt.

The shell hangs, but exits with C-d

Builtins affected:
echo hi > outfile
pwd > outfile
env > outfile
2025-04-18 14:14:43 +02:00
655ff36351 fix(susbt/variable): empty variables on their own are removed 2025-04-18 09:22:18 +02:00
5e6d7b3b4e fix(parsing/here_doc): segfault & invalid fd & premature exit 2025-04-17 11:25:59 +02:00
733ae1093a fix(exec): correctly exit subprocesses, do not keep multiple shells in parallel 2025-04-16 17:30:25 +02:00
2ea4afda4a clean: move around some imports 2025-04-16 16:41:54 +02:00
18225f3356 fix(executing): return code on unknown cmd was unchanged, is now set to 127 2025-04-16 15:00:20 +02:00
81ba53237c parsing: do not reset last_return_value at start of parsing
we need to preserve it, to be able to show the return value from the last command
2025-04-15 15:45:29 +02:00
81febcfcdd
debug: show command about to be executed in debug mode 2025-04-15 15:19:27 +02:00
ba9751e089
do postprocessing for each simple_cmd before execution 2025-04-15 15:13:17 +02:00
bb1390aac5
simple_cmd_execute: handle redirections
I am very uncertain on if this is actually correct, but I am unable to test it
very much atm
2025-04-15 15:11:50 +02:00
425722801b
refactor(do_waitpid): put into own file for easier acces from other modules 2025-04-15 15:11:26 +02:00
881c7f264c
signal: if a command is terminated by SIGQUIT, display that it core dumped 2025-04-15 15:11:11 +02:00
f1c132337b
exit: work for simple arguments
This does not address non-integer arguments, or extremly high/low arguments.
2025-04-15 15:03:13 +02:00
24ba87abba
exec: retain exit status of commands, including if they were signaled 2025-04-15 15:01:19 +02:00
5b7367925f
simple_cmd refactor: put subprocess functions in own file
This clears some space for new functions later
2025-04-15 14:41:44 +02:00
cea8043ec9
simple_cmd executing: show error in case execve fails
We don't have to check the return status, since execve only returns on failure.

Fixes #52
2025-04-15 14:41:43 +02:00
0a80b9fbe3
simple_cmd executing refactor: put builtin related utilities into own file 2025-04-01 16:38:41 +02:00
299e016a27
export: handle simple cases 2025-04-01 14:39:02 +02:00
e93e6efb93
builtins: cd: implement cd to absolute paths 2025-03-31 16:34:48 +02:00
5ce4a2b85f
builtin: implement pwd 2025-03-31 14:54:40 +02:00
66ea1328aa
simple_cmd executing: print error message on command not found 2025-03-28 16:58:13 +01:00
befe219436
simple_cmd executing: works with arguments and env
Does not handle redirections at all, no special facilities are in place to allow
nofork or builtin execution.
2025-03-28 14:50:37 +01:00