use raw mode for linux so that I can later implement history and such. also update msh_read_input doc because i think it's gonna return more stuff soon

This commit is contained in:
IoIxD 2026-01-20 17:09:58 -07:00
commit fb3e073565
6 changed files with 95 additions and 17 deletions

View file

@ -4,18 +4,24 @@
int hashes_calced = 0;
int cd_hash = 0;
int exit_hash = 0;
int msh_try_builtin(char *cmd, char **args) {
int hash = str_hash(cmd);
if (hashes_calced == 0) {
cd_hash = str_hash("cd");
exit_hash = str_hash("exit");
hashes_calced = 1;
}
if (hash == cd_hash) {
msh_builtin_cd(args[1]);
return 1;
}
if (hash == exit_hash) {
msh_exit_shell();
return 0;
}
return 0;
};