… | |
… | |
1079 | * GET TTY CURRENT STATE * |
1079 | * GET TTY CURRENT STATE * |
1080 | * ------------------------------------------------------------------------- */ |
1080 | * ------------------------------------------------------------------------- */ |
1081 | void |
1081 | void |
1082 | rxvt_get_ttymode (ttymode_t *tio, int erase) |
1082 | rxvt_get_ttymode (ttymode_t *tio, int erase) |
1083 | { |
1083 | { |
1084 | #ifdef HAVE_TERMIOS_H |
|
|
1085 | /* |
1084 | /* |
1086 | * standard System V termios interface |
1085 | * standard System V termios interface |
1087 | */ |
1086 | */ |
1088 | if (GET_TERMIOS (STDIN_FILENO, tio) < 0) |
1087 | if (GET_TERMIOS (STDIN_FILENO, tio) < 0) |
1089 | { |
1088 | { |
… | |
… | |
1156 | tio->c_lflag = (ISIG | ICANON | IEXTEN | ECHO |
1155 | tio->c_lflag = (ISIG | ICANON | IEXTEN | ECHO |
1157 | # if defined (ECHOCTL) && defined (ECHOKE) |
1156 | # if defined (ECHOCTL) && defined (ECHOKE) |
1158 | | ECHOCTL | ECHOKE |
1157 | | ECHOCTL | ECHOKE |
1159 | # endif |
1158 | # endif |
1160 | | ECHOE | ECHOK); |
1159 | | ECHOE | ECHOK); |
1161 | # else /* HAVE_TERMIOS_H */ |
|
|
1162 | |
|
|
1163 | /* |
|
|
1164 | * sgtty interface |
|
|
1165 | */ |
|
|
1166 | |
|
|
1167 | /* get parameters -- gtty */ |
|
|
1168 | if (ioctl (STDIN_FILENO, TIOCGETP, & (tio->sg)) < 0) |
|
|
1169 | { |
|
|
1170 | tio->sg.sg_erase = CERASE; /* ^H */ |
|
|
1171 | tio->sg.sg_kill = CKILL; /* ^U */ |
|
|
1172 | } |
|
|
1173 | |
|
|
1174 | if (erase != -1) |
|
|
1175 | tio->sg.sg_erase = (char)erase; |
|
|
1176 | |
|
|
1177 | tio->sg.sg_flags = (CRMOD | ECHO | EVENP | ODDP); |
|
|
1178 | |
|
|
1179 | /* get special characters */ |
|
|
1180 | if (ioctl (STDIN_FILENO, TIOCGETC, & (tio->tc)) < 0) |
|
|
1181 | { |
|
|
1182 | tio->tc.t_intrc = CINTR; /* ^C */ |
|
|
1183 | tio->tc.t_quitc = CQUIT; /* ^\ */ |
|
|
1184 | tio->tc.t_startc = CSTART; /* ^Q */ |
|
|
1185 | tio->tc.t_stopc = CSTOP; /* ^S */ |
|
|
1186 | tio->tc.t_eofc = CEOF; /* ^D */ |
|
|
1187 | tio->tc.t_brkc = -1; |
|
|
1188 | } |
|
|
1189 | |
|
|
1190 | /* get local special chars */ |
|
|
1191 | if (ioctl (STDIN_FILENO, TIOCGLTC, & (tio->lc)) < 0) |
|
|
1192 | { |
|
|
1193 | tio->lc.t_suspc = CSUSP; /* ^Z */ |
|
|
1194 | tio->lc.t_dsuspc = CDSUSP; /* ^Y */ |
|
|
1195 | tio->lc.t_rprntc = CRPRNT; /* ^R */ |
|
|
1196 | tio->lc.t_flushc = CFLUSH; /* ^O */ |
|
|
1197 | tio->lc.t_werasc = CWERASE; /* ^W */ |
|
|
1198 | tio->lc.t_lnextc = CLNEXT; /* ^V */ |
|
|
1199 | } |
|
|
1200 | /* get line discipline */ |
|
|
1201 | ioctl (STDIN_FILENO, TIOCGETD, & (tio->line)); |
|
|
1202 | # ifdef NTTYDISC |
|
|
1203 | tio->line = NTTYDISC; |
|
|
1204 | # endif /* NTTYDISC */ |
|
|
1205 | |
|
|
1206 | tio->local = (LCRTBS | LCRTERA | LCTLECH | LPASS8 | LCRTKIL); |
|
|
1207 | #endif /* HAVE_TERMIOS_H */ |
|
|
1208 | |
1160 | |
1209 | /* |
1161 | /* |
1210 | * Debugging |
1162 | * Debugging |
1211 | */ |
1163 | */ |
1212 | #ifdef DEBUG_TTYMODE |
1164 | #ifdef DEBUG_TTYMODE |