diff options
| author | Stefan Monnier | 2010-04-12 22:07:48 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2010-04-12 22:07:48 -0400 |
| commit | 2b0a91e78f83fb446cc38efb99399e83ad2cded3 (patch) | |
| tree | 7f387f7fe5cba2a8889e8a4de9ec22686ff29c22 /src/sysdep.c | |
| parent | 58b963f7f3d9d8e869408666608c05f3c69a5cb5 (diff) | |
| download | emacs-2b0a91e78f83fb446cc38efb99399e83ad2cded3.tar.gz emacs-2b0a91e78f83fb446cc38efb99399e83ad2cded3.zip | |
Try to solve the problem of spurious EOF chars in long lines of text
sent to interactive subprocesses.
* sysdep.c (child_setup_tty): Do not enable ICANON any more.
(system_process_attributes): Remove unused var `ttotal'.
* process.c (send_process): Don't bother breaking long line with EOF
chars when talking to ttys any more.
(wait_reading_process_output): Output a warning when called in such
a way that it could block without being interruptible.
Diffstat (limited to 'src/sysdep.c')
| -rw-r--r-- | src/sysdep.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/sysdep.c b/src/sysdep.c index 37e7dfbaf9c..506af23ef30 100644 --- a/src/sysdep.c +++ b/src/sysdep.c | |||
| @@ -529,8 +529,6 @@ child_setup_tty (out) | |||
| 529 | #endif | 529 | #endif |
| 530 | s.main.c_oflag &= ~TAB3; /* Disable tab expansion */ | 530 | s.main.c_oflag &= ~TAB3; /* Disable tab expansion */ |
| 531 | s.main.c_cflag = (s.main.c_cflag & ~CSIZE) | CS8; /* Don't strip 8th bit */ | 531 | s.main.c_cflag = (s.main.c_cflag & ~CSIZE) | CS8; /* Don't strip 8th bit */ |
| 532 | s.main.c_lflag |= ICANON; /* Enable erase/kill and eof processing */ | ||
| 533 | s.main.c_cc[VEOF] = 04; /* insure that EOF is Control-D */ | ||
| 534 | s.main.c_cc[VERASE] = CDISABLE; /* disable erase processing */ | 532 | s.main.c_cc[VERASE] = CDISABLE; /* disable erase processing */ |
| 535 | s.main.c_cc[VKILL] = CDISABLE; /* disable kill processing */ | 533 | s.main.c_cc[VKILL] = CDISABLE; /* disable kill processing */ |
| 536 | 534 | ||
| @@ -560,7 +558,6 @@ child_setup_tty (out) | |||
| 560 | /* rms: Formerly it set s.main.c_cc[VINTR] to 0377 here | 558 | /* rms: Formerly it set s.main.c_cc[VINTR] to 0377 here |
| 561 | unconditionally. Then a SIGNALS_VIA_CHARACTERS conditional | 559 | unconditionally. Then a SIGNALS_VIA_CHARACTERS conditional |
| 562 | would force it to 0377. That looks like duplicated code. */ | 560 | would force it to 0377. That looks like duplicated code. */ |
| 563 | s.main.c_cc[VEOL] = CDISABLE; | ||
| 564 | s.main.c_cflag = (s.main.c_cflag & ~CBAUD) | B9600; /* baud rate sanity */ | 561 | s.main.c_cflag = (s.main.c_cflag & ~CBAUD) | B9600; /* baud rate sanity */ |
| 565 | #endif /* AIX */ | 562 | #endif /* AIX */ |
| 566 | 563 | ||
| @@ -573,6 +570,18 @@ child_setup_tty (out) | |||
| 573 | s.main.sg_kill = 0377; | 570 | s.main.sg_kill = 0377; |
| 574 | s.lmode = LLITOUT | s.lmode; /* Don't strip 8th bit */ | 571 | s.lmode = LLITOUT | s.lmode; /* Don't strip 8th bit */ |
| 575 | 572 | ||
| 573 | /* We used to enable ICANON (and set VEOF to 04), but this leads to | ||
| 574 | problems where process.c wants to send EOFs every once in a while | ||
| 575 | to force the output, which leads to weird effects when the | ||
| 576 | subprocess has disabled ICANON and ends up seeing those spurious | ||
| 577 | extra EOFs. So we don't send EOFs any more in | ||
| 578 | process.c:send_process, and instead we disable ICANON by default, | ||
| 579 | so if a subsprocess sets up ICANON, it's his problem (or the Elisp | ||
| 580 | package that talks to it) to deal with lines that are too long. */ | ||
| 581 | s.main.c_lflag &= ~ICANON; /* Disable line editing and eof processing */ | ||
| 582 | s.main.c_cc[VMIN] = 1; | ||
| 583 | s.main.c_cc[VTIME] = 0; | ||
| 584 | |||
| 576 | #endif /* not HAVE_TERMIO */ | 585 | #endif /* not HAVE_TERMIO */ |
| 577 | 586 | ||
| 578 | EMACS_SET_TTY (out, &s, 0); | 587 | EMACS_SET_TTY (out, &s, 0); |
| @@ -3344,7 +3353,7 @@ system_process_attributes (Lisp_Object pid) | |||
| 3344 | unsigned long minflt, majflt, cminflt, cmajflt, vsize; | 3353 | unsigned long minflt, majflt, cminflt, cmajflt, vsize; |
| 3345 | time_t sec; | 3354 | time_t sec; |
| 3346 | unsigned usec; | 3355 | unsigned usec; |
| 3347 | EMACS_TIME tnow, tstart, tboot, telapsed,ttotal; | 3356 | EMACS_TIME tnow, tstart, tboot, telapsed; |
| 3348 | double pcpu, pmem; | 3357 | double pcpu, pmem; |
| 3349 | Lisp_Object attrs = Qnil; | 3358 | Lisp_Object attrs = Qnil; |
| 3350 | Lisp_Object cmd_str, decoded_cmd, tem; | 3359 | Lisp_Object cmd_str, decoded_cmd, tem; |