fix
This commit is contained in:
parent
33d2c21792
commit
fd5afa4833
4
term.c
4
term.c
|
@ -13,14 +13,14 @@ int main(int argc, char **argv) {
|
|||
int fdm = -1; // allocate file descriptor
|
||||
|
||||
// allocate a pty, fork, inititialize file descriptor
|
||||
pid_t pid = forkpty(&fdm, NULL, NULL, NULL);
|
||||
pid_t pid = forkpty(&fdm, NULL, NULL, NULL);
|
||||
|
||||
if (pid < 0) { // failure
|
||||
perror("fork failed");
|
||||
return 1;
|
||||
} else if (pid == 0) { // child
|
||||
setenv("TERM", "ansi", 1);
|
||||
execlp("bash", "bash", NULL); // exec bash
|
||||
execlp("bash", "bash", NULL); // exec bash
|
||||
perror("exec bash failed");
|
||||
} else { // parent
|
||||
struct winsize ws = {23, 80, 8, 12}; // rows, cols, xps, ypx
|
||||
|
|
Loading…
Reference in New Issue