1994-11-27 14:49:59 +00:00
|
|
|
*** Unix/ui.c.orig Sun Feb 13 17:45:57 1994
|
|
|
|
--- Unix/ui.c Sun Nov 27 15:06:44 1994
|
1994-10-02 23:15:02 +00:00
|
|
|
***************
|
1994-11-27 14:49:59 +00:00
|
|
|
*** 69,74 ****
|
|
|
|
--- 69,76 ----
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
+ #include "defs.h"
|
|
|
|
+
|
|
|
|
#ifdef dec
|
|
|
|
#define stub_only
|
|
|
|
#endif
|
|
|
|
***************
|
|
|
|
*** 82,92 ****
|
|
|
|
#include <sys/termio.h>
|
|
|
|
#endif
|
|
|
|
#ifdef __386BSD__
|
|
|
|
#include <sys/ioctl.h>
|
|
|
|
#endif
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <signal.h>
|
|
|
|
- #include "defs.h"
|
|
|
|
#include "extern.h"
|
|
|
|
#include "tags.h"
|
|
|
|
#include "prefs.h"
|
|
|
|
--- 84,95 ----
|
1994-10-02 23:15:02 +00:00
|
|
|
#include <sys/termio.h>
|
|
|
|
#endif
|
|
|
|
#ifdef __386BSD__
|
|
|
|
+ #include <fcntl.h>
|
|
|
|
#include <sys/ioctl.h>
|
|
|
|
+ #define termio termios
|
|
|
|
#endif
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <signal.h>
|
1994-11-27 14:49:59 +00:00
|
|
|
#include "extern.h"
|
|
|
|
#include "tags.h"
|
|
|
|
#include "prefs.h"
|
1994-10-02 23:15:02 +00:00
|
|
|
***************
|
|
|
|
*** 193,198 ****
|
1994-11-27 14:49:59 +00:00
|
|
|
--- 196,202 ----
|
1994-10-02 23:15:02 +00:00
|
|
|
if (run_in_fg())
|
|
|
|
{
|
|
|
|
#ifdef __386BSD__
|
|
|
|
+ fcntl(fileno(stdin), F_SETFL, O_NONBLOCK);
|
|
|
|
tcgetattr(fileno(stdin), &zap);
|
|
|
|
#else
|
|
|
|
ioctl(fileno(stdin), TCGETA, &zap);
|
|
|
|
***************
|
|
|
|
*** 217,223 ****
|
|
|
|
#endif
|
|
|
|
zap.c_lflag &= ~(ICANON | ECHO);
|
|
|
|
#ifdef __386BSD__
|
|
|
|
! tcsetattr(fileno(stdin, TCSANOW, &zap);
|
|
|
|
#else
|
|
|
|
ioctl(fileno(stdin), TCSETA, &zap);
|
|
|
|
#endif
|
1994-11-27 14:49:59 +00:00
|
|
|
--- 221,227 ----
|
1994-10-02 23:15:02 +00:00
|
|
|
#endif
|
|
|
|
zap.c_lflag &= ~(ICANON | ECHO);
|
|
|
|
#ifdef __386BSD__
|
|
|
|
! tcsetattr(fileno(stdin), TCSANOW, &zap);
|
|
|
|
#else
|
|
|
|
ioctl(fileno(stdin), TCSETA, &zap);
|
|
|
|
#endif
|
|
|
|
***************
|
|
|
|
*** 227,232 ****
|
1994-11-27 14:49:59 +00:00
|
|
|
--- 231,245 ----
|
1994-10-02 23:15:02 +00:00
|
|
|
is_fg = FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
+ /* if_fg_sane_tty():
|
|
|
|
+ * restore tty modes, if running in foreground
|
|
|
|
+ */
|
|
|
|
+ LOCAL void if_fg_sane_tty()
|
|
|
|
+ {
|
|
|
|
+ if (run_in_fg())
|
|
|
|
+ sane_tty();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
/* nonblocking_io():
|
|
|
|
* try to setup the keyboard to non blocking io
|
|
|
|
*/
|
|
|
|
***************
|
|
|
|
*** 240,252 ****
|
|
|
|
{
|
|
|
|
psanity = &sanity;
|
|
|
|
#ifdef __386BSD__
|
|
|
|
! tcgetattr(fileno(stdin), &sanity);
|
|
|
|
#else
|
|
|
|
ioctl(fileno(stdin), TCGETA, psanity);
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
switch_mode();
|
|
|
|
! at_end(sane_tty);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
1994-11-27 14:49:59 +00:00
|
|
|
--- 253,265 ----
|
1994-10-02 23:15:02 +00:00
|
|
|
{
|
|
|
|
psanity = &sanity;
|
|
|
|
#ifdef __386BSD__
|
|
|
|
! tcgetattr(fileno(stdin), psanity);
|
|
|
|
#else
|
|
|
|
ioctl(fileno(stdin), TCGETA, psanity);
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
switch_mode();
|
|
|
|
! at_end(if_fg_sane_tty);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
***************
|
|
|
|
*** 255,261 ****
|
|
|
|
LOCAL void sane_tty()
|
|
|
|
{
|
|
|
|
#ifdef __386BSD__
|
|
|
|
! tcsetattr(fileno(stdin), &sanity);
|
|
|
|
#else
|
|
|
|
ioctl(fileno(stdin), TCSETA, psanity);
|
|
|
|
#endif
|
1994-11-27 14:49:59 +00:00
|
|
|
--- 268,274 ----
|
1994-10-02 23:15:02 +00:00
|
|
|
LOCAL void sane_tty()
|
|
|
|
{
|
|
|
|
#ifdef __386BSD__
|
|
|
|
! tcsetattr(fileno(stdin), TCSADRAIN, psanity);
|
|
|
|
#else
|
|
|
|
ioctl(fileno(stdin), TCSETA, psanity);
|
|
|
|
#endif
|