Added buffer to the console
Added hotkeys to switch between console buffers and to return to the home one Added clear screen command Added debug text outputs to the hello command and when loading sh
This commit is contained in:
15
screen.c
15
screen.c
@ -5,20 +5,27 @@ int main(int argc, char *argv[]) {
|
||||
//int consoles = 0;
|
||||
int pid;
|
||||
//char* comment = "";
|
||||
|
||||
|
||||
for (int i = 1; i < argc; i++) {
|
||||
if (strcmp(argv[i], "-c") == 0) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
pid = fork();
|
||||
pid = fork();
|
||||
if (pid < 0) {
|
||||
printf(1, "screen: fork failed\n");
|
||||
}
|
||||
if (pid == 0) {
|
||||
exec("sh", argv);
|
||||
printf(1, "screen: exec sh failed\n");
|
||||
if (screen() != 0)
|
||||
{
|
||||
exec("sh", argv);
|
||||
printf(1, "screen: exec sh failed\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
printf(1, "screen: failed to create a new console\n");
|
||||
}
|
||||
}
|
||||
exit();
|
||||
}
|
Reference in New Issue
Block a user