1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
--- src/term.c.orig Sat Mar 29 04:36:54 1997
+++ src/term.c Tue Feb 20 23:43:44 2001
@@ -30,7 +30,13 @@
#include <termio.h>
#elif defined(__FreeBSD__)
#include <termios.h>
-#include <machine/console.h>
+#include <osreldate.h>
+#if __FreeBSD_version >= 410000
+# include <sys/consio.h>
+# include <sys/kbio.h>
+#else
+# include <machine/console.h>
+#endif
#define termio termios
#endif
#include <signal.h>
@@ -209,6 +215,9 @@
}
if (FD_ISSET(0, &readFds)) {
i = read(0, buff, BUFSIZ);
+#if defined(__FreeBSD__)
+ i = cons25tovt100(buff, i, BUFSIZ);
+#endif
#if 1
{
int k, l;
@@ -239,7 +248,7 @@
PollCursor(TRUE);
}
if (FD_ISSET(sockFd, &readFds)) SocketInterface(sockFd);
- if (mInfo.has_mouse) {
+ if (mInfo.has_mouse && mouseFd > 0) {
if (FD_ISSET(mouseFd, &readFds) && con.active) {
i = read(mouseFd, buff, BUFSIZ);
if (i > 0) MouseGetPacket(buff, i);
|