… | |
… | |
206 | refresh_type = SLOW_REFRESH; |
206 | refresh_type = SLOW_REFRESH; |
207 | |
207 | |
208 | oldcursor.row = oldcursor.col = -1; |
208 | oldcursor.row = oldcursor.col = -1; |
209 | #ifdef XPM_BACKGROUND |
209 | #ifdef XPM_BACKGROUND |
210 | /* bgPixmap.w = bgPixmap.h = 0; */ |
210 | /* bgPixmap.w = bgPixmap.h = 0; */ |
211 | bgPixmap.x = bgPixmap.y = 50; |
211 | bgPixmap.x = bgPixmap.y = 0; |
212 | bgPixmap.pixmap = None; |
212 | bgPixmap.pixmap = None; |
213 | #endif |
213 | #endif |
214 | |
214 | |
215 | last_bot = last_state = -1; |
215 | last_bot = last_state = -1; |
216 | |
216 | |
… | |
… | |
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 |
… | |
… | |
1313 | else |
1265 | else |
1314 | #endif |
1266 | #endif |
1315 | if (!pty->get ()) |
1267 | if (!pty->get ()) |
1316 | rxvt_fatal ("can't initialize pseudo-tty, aborting.\n"); |
1268 | rxvt_fatal ("can't initialize pseudo-tty, aborting.\n"); |
1317 | |
1269 | |
1318 | pty->set_utf8_mode (enc_utf8); |
|
|
1319 | |
|
|
1320 | /* set initial window size */ |
|
|
1321 | tt_winch (); |
|
|
1322 | |
|
|
1323 | int er; |
1270 | int er; |
1324 | |
1271 | |
1325 | #ifndef NO_BACKSPACE_KEY |
1272 | #ifndef NO_BACKSPACE_KEY |
1326 | if (key_backspace[0] && !key_backspace[1]) |
1273 | if (key_backspace[0] && !key_backspace[1]) |
1327 | er = key_backspace[0]; |
1274 | er = key_backspace[0]; |
… | |
… | |
1330 | else |
1277 | else |
1331 | #endif |
1278 | #endif |
1332 | er = -1; |
1279 | er = -1; |
1333 | |
1280 | |
1334 | rxvt_get_ttymode (&tio, er); |
1281 | rxvt_get_ttymode (&tio, er); |
|
|
1282 | SET_TERMIOS (pty->tty, &tio); /* init terminal attributes */ |
|
|
1283 | pty->set_utf8_mode (enc_utf8); |
|
|
1284 | |
|
|
1285 | /* set initial window size */ |
|
|
1286 | tt_winch (); |
1335 | |
1287 | |
1336 | #if ENABLE_FRILLS |
1288 | #if ENABLE_FRILLS |
1337 | if (rs[Rs_pty_fd]) |
1289 | if (rs[Rs_pty_fd]) |
1338 | return; |
1290 | return; |
1339 | #endif |
1291 | #endif |
… | |
… | |
1393 | */ |
1345 | */ |
1394 | int |
1346 | int |
1395 | rxvt_term::run_child (const char *const *argv) |
1347 | rxvt_term::run_child (const char *const *argv) |
1396 | { |
1348 | { |
1397 | char *login; |
1349 | char *login; |
1398 | |
|
|
1399 | SET_TTYMODE (STDIN_FILENO, &tio); /* init terminal attributes */ |
|
|
1400 | |
1350 | |
1401 | if (OPTION (Opt_console)) |
1351 | if (OPTION (Opt_console)) |
1402 | { /* be virtual console, fail silently */ |
1352 | { /* be virtual console, fail silently */ |
1403 | #ifdef TIOCCONS |
1353 | #ifdef TIOCCONS |
1404 | unsigned int on = 1; |
1354 | unsigned int on = 1; |