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:
parent
efeeb73ef5
commit
fb3e073565
6 changed files with 95 additions and 17 deletions
|
|
@ -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;
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue