
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
31 lines
675 B
C
31 lines
675 B
C
#include "types.h"
|
|
#include "user.h"
|
|
|
|
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();
|
|
if (pid < 0) {
|
|
printf(1, "screen: fork failed\n");
|
|
}
|
|
if (pid == 0) {
|
|
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();
|
|
}
|