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
|
int fdm = -1; // allocate file descriptor
|
||||||
|
|
||||||
// allocate a pty, fork, inititialize 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
|
if (pid < 0) { // failure
|
||||||
perror("fork failed");
|
perror("fork failed");
|
||||||
return 1;
|
return 1;
|
||||||
} else if (pid == 0) { // child
|
} else if (pid == 0) { // child
|
||||||
setenv("TERM", "ansi", 1);
|
setenv("TERM", "ansi", 1);
|
||||||
execlp("bash", "bash", NULL); // exec bash
|
execlp("bash", "bash", NULL); // exec bash
|
||||||
perror("exec bash failed");
|
perror("exec bash failed");
|
||||||
} else { // parent
|
} else { // parent
|
||||||
struct winsize ws = {23, 80, 8, 12}; // rows, cols, xps, ypx
|
struct winsize ws = {23, 80, 8, 12}; // rows, cols, xps, ypx
|
||||||
|
|
1
term.tal
1
term.tal
|
@ -11,6 +11,7 @@
|
||||||
( c. etc. )
|
( c. etc. )
|
||||||
( 6. add more ansi control seqs )
|
( 6. add more ansi control seqs )
|
||||||
( 7. stop hard coding terminal size in both term.py and term.tal )
|
( 7. stop hard coding terminal size in both term.py and term.tal )
|
||||||
|
( 8. key repeat - not possible in general though )
|
||||||
|
|
||||||
( ANSI sequences )
|
( ANSI sequences )
|
||||||
( )
|
( )
|
||||||
|
|
Loading…
Reference in New Issue