1 | /*--------------------------------*-C-*---------------------------------* |
1 | /*----------------------------------------------------------------------* |
2 | * File: init.C |
2 | * File: init.C |
3 | *----------------------------------------------------------------------* |
3 | *----------------------------------------------------------------------* |
4 | * |
4 | * |
5 | * All portions of code are copyright by their respective author/s. |
5 | * All portions of code are copyright by their respective author/s. |
6 | * Copyright (c) 1992 John Bovey, University of Kent at Canterbury <jdb@ukc.ac.uk> |
6 | * Copyright (c) 1992 John Bovey, University of Kent at Canterbury <jdb@ukc.ac.uk> |
… | |
… | |
300 | rxvt_fatal ("can't open display %s, aborting.\n", rs[Rs_display_name]); |
300 | rxvt_fatal ("can't open display %s, aborting.\n", rs[Rs_display_name]); |
301 | |
301 | |
302 | // using a local pointer decreases code size a lot |
302 | // using a local pointer decreases code size a lot |
303 | xa = display->xa; |
303 | xa = display->xa; |
304 | |
304 | |
|
|
305 | set (display); |
|
|
306 | extract_resources (); |
|
|
307 | |
305 | #if XFT |
308 | #if XFT |
306 | if (rs[Rs_depth]) |
309 | if (rs[Rs_depth]) |
307 | set (display, strtol (rs[Rs_depth], 0, 0)); |
310 | select_visual (strtol (rs[Rs_depth], 0, 0)); |
308 | else |
|
|
309 | #endif |
311 | #endif |
310 | set (display); |
|
|
311 | |
|
|
312 | extract_resources (); |
|
|
313 | |
312 | |
314 | free (r_argv); |
313 | free (r_argv); |
315 | |
314 | |
316 | for (int i = NUM_RESOURCES; i--; ) |
315 | for (int i = NUM_RESOURCES; i--; ) |
317 | if (rs [i] == resval_undef) |
316 | if (rs [i] == resval_undef) |
… | |
… | |
749 | alias_color (Color_topShadow, Color_White); |
748 | alias_color (Color_topShadow, Color_White); |
750 | } |
749 | } |
751 | #endif /* KEEP_SCROLLCOLOR */ |
750 | #endif /* KEEP_SCROLLCOLOR */ |
752 | |
751 | |
753 | #ifdef OFF_FOCUS_FADING |
752 | #ifdef OFF_FOCUS_FADING |
754 | if (rs[Rs_fade]) |
|
|
755 | for (i = 0; i < (depth <= 2 ? 2 : NRS_COLORS); i++) |
753 | for (i = 0; i < (depth <= 2 ? 2 : NRS_COLORS); i++) |
756 | { |
754 | update_fade_color (i); |
757 | rgba c; |
|
|
758 | pix_colors [Color_fade].get (c); |
|
|
759 | pix_colors_focused [i].fade (this, atoi (rs[Rs_fade]), pix_colors_unfocused[i],c); |
|
|
760 | } |
|
|
761 | #endif |
755 | #endif |
762 | } |
756 | } |
763 | |
757 | |
764 | /*----------------------------------------------------------------------*/ |
758 | /*----------------------------------------------------------------------*/ |
765 | /* color aliases, fg/bg bright-bold */ |
759 | /* color aliases, fg/bg bright-bold */ |
… | |
… | |
1319 | else |
1313 | else |
1320 | #endif |
1314 | #endif |
1321 | if (!pty->get ()) |
1315 | if (!pty->get ()) |
1322 | rxvt_fatal ("can't initialize pseudo-tty, aborting.\n"); |
1316 | rxvt_fatal ("can't initialize pseudo-tty, aborting.\n"); |
1323 | |
1317 | |
1324 | pty->set_utf8_mode (enc_utf8); |
|
|
1325 | |
|
|
1326 | /* set initial window size */ |
|
|
1327 | tt_winch (); |
|
|
1328 | |
|
|
1329 | int er; |
1318 | int er; |
1330 | |
1319 | |
1331 | #ifndef NO_BACKSPACE_KEY |
1320 | #ifndef NO_BACKSPACE_KEY |
1332 | if (key_backspace[0] && !key_backspace[1]) |
1321 | if (key_backspace[0] && !key_backspace[1]) |
1333 | er = key_backspace[0]; |
1322 | er = key_backspace[0]; |
… | |
… | |
1336 | else |
1325 | else |
1337 | #endif |
1326 | #endif |
1338 | er = -1; |
1327 | er = -1; |
1339 | |
1328 | |
1340 | rxvt_get_ttymode (&tio, er); |
1329 | rxvt_get_ttymode (&tio, er); |
|
|
1330 | pty->set_utf8_mode (enc_utf8); |
|
|
1331 | SET_TTYMODE (STDIN_FILENO, &tio); /* init terminal attributes */ |
|
|
1332 | |
|
|
1333 | /* set initial window size */ |
|
|
1334 | tt_winch (); |
1341 | |
1335 | |
1342 | #if ENABLE_FRILLS |
1336 | #if ENABLE_FRILLS |
1343 | if (rs[Rs_pty_fd]) |
1337 | if (rs[Rs_pty_fd]) |
1344 | return; |
1338 | return; |
1345 | #endif |
1339 | #endif |
… | |
… | |
1399 | */ |
1393 | */ |
1400 | int |
1394 | int |
1401 | rxvt_term::run_child (const char *const *argv) |
1395 | rxvt_term::run_child (const char *const *argv) |
1402 | { |
1396 | { |
1403 | char *login; |
1397 | char *login; |
1404 | |
|
|
1405 | SET_TTYMODE (STDIN_FILENO, &tio); /* init terminal attributes */ |
|
|
1406 | |
1398 | |
1407 | if (OPTION (Opt_console)) |
1399 | if (OPTION (Opt_console)) |
1408 | { /* be virtual console, fail silently */ |
1400 | { /* be virtual console, fail silently */ |
1409 | #ifdef TIOCCONS |
1401 | #ifdef TIOCCONS |
1410 | unsigned int on = 1; |
1402 | unsigned int on = 1; |