… | |
… | |
459 | |
459 | |
460 | /* no point having a scrollbar without having any scrollback! */ |
460 | /* no point having a scrollbar without having any scrollback! */ |
461 | if (!saveLines) |
461 | if (!saveLines) |
462 | set_option (Opt_scrollBar, 0); |
462 | set_option (Opt_scrollBar, 0); |
463 | |
463 | |
464 | #ifdef PRINTPIPE |
|
|
465 | if (!rs[Rs_print_pipe]) |
|
|
466 | rs[Rs_print_pipe] = PRINTPIPE; |
|
|
467 | #endif |
|
|
468 | |
|
|
469 | if (!rs[Rs_cutchars]) |
464 | if (!rs[Rs_cutchars]) |
470 | rs[Rs_cutchars] = CUTCHARS; |
465 | rs[Rs_cutchars] = CUTCHARS; |
471 | |
466 | |
472 | #ifndef NO_BACKSPACE_KEY |
467 | #ifndef NO_BACKSPACE_KEY |
473 | if (!rs[Rs_backspace_key]) |
468 | if (!rs[Rs_backspace_key]) |
… | |
… | |
485 | # else |
480 | # else |
486 | rs[Rs_delete_key] = "\033[3~"; |
481 | rs[Rs_delete_key] = "\033[3~"; |
487 | # endif |
482 | # endif |
488 | #endif |
483 | #endif |
489 | |
484 | |
490 | setup_scrollbar (rs[Rs_scrollBar_align], rs[Rs_scrollstyle], rs[Rs_scrollBar_thickness]); |
485 | scrollBar.setup (this); |
491 | |
486 | |
492 | #ifdef XTERM_REVERSE_VIDEO |
487 | #ifdef XTERM_REVERSE_VIDEO |
493 | /* this is how xterm implements reverseVideo */ |
488 | /* this is how xterm implements reverseVideo */ |
494 | if (option (Opt_reverseVideo)) |
489 | if (option (Opt_reverseVideo)) |
495 | { |
490 | { |
… | |
… | |
539 | { |
534 | { |
540 | this->envv = envv; |
535 | this->envv = envv; |
541 | |
536 | |
542 | SET_R (this); |
537 | SET_R (this); |
543 | set_locale (""); |
538 | set_locale (""); |
544 | set_environ (envv); // few things in X do not call setlocale :( |
539 | set_environ (envv); // a few things in X do not call setlocale :( |
545 | |
540 | |
546 | init_vars (); |
541 | init_vars (); |
547 | |
542 | |
548 | init_secondary (); |
543 | init_secondary (); |
549 | |
544 | |
… | |
… | |
551 | |
546 | |
552 | #ifdef KEYSYM_RESOURCE |
547 | #ifdef KEYSYM_RESOURCE |
553 | keyboard->register_done (); |
548 | keyboard->register_done (); |
554 | #endif |
549 | #endif |
555 | |
550 | |
|
|
551 | if (const char *path = rs[Rs_chdir]) |
|
|
552 | if (*path) // ignored if empty |
|
|
553 | { |
|
|
554 | if (*path != '/') |
|
|
555 | rxvt_fatal ("specified shell working directory must start with a slash, aborting.\n"); |
|
|
556 | |
|
|
557 | if (chdir (path)) |
|
|
558 | rxvt_fatal ("unable to change into specified shell working directory, aborting.\n"); |
|
|
559 | } |
|
|
560 | |
556 | if (option (Opt_scrollBar)) |
561 | if (option (Opt_scrollBar)) |
557 | scrollBar.setIdle (); /* set existence for size calculations */ |
562 | scrollBar.state = STATE_IDLE; /* set existence for size calculations */ |
558 | |
563 | |
559 | pty = ptytty::create (); |
564 | pty = ptytty::create (); |
560 | |
565 | |
561 | create_windows (argc, argv); |
566 | create_windows (argc, argv); |
562 | |
567 | |
… | |
… | |
567 | #if 0 |
572 | #if 0 |
568 | XSynchronize (dpy, True); |
573 | XSynchronize (dpy, True); |
569 | #endif |
574 | #endif |
570 | |
575 | |
571 | if (option (Opt_scrollBar)) |
576 | if (option (Opt_scrollBar)) |
572 | resize_scrollbar (); /* create and map scrollbar */ |
577 | scrollBar.resize (); /* create and map scrollbar */ |
573 | #ifdef HAVE_BG_PIXMAP |
578 | #ifdef HAVE_BG_PIXMAP |
574 | { |
579 | { |
575 | bgPixmap.set_target (this); |
580 | bgPixmap.set_target (this); |
576 | bgPixmap.invalidate (); |
581 | bgPixmap.invalidate (); |
577 | |
582 | |
… | |
… | |
832 | run_command (argv); |
837 | run_command (argv); |
833 | } |
838 | } |
834 | |
839 | |
835 | /*----------------------------------------------------------------------*/ |
840 | /*----------------------------------------------------------------------*/ |
836 | void |
841 | void |
837 | rxvt_term::Get_Colours () |
842 | rxvt_term::get_colours () |
838 | { |
843 | { |
839 | int i; |
844 | int i; |
840 | |
845 | |
841 | #ifdef OFF_FOCUS_FADING |
846 | #ifdef OFF_FOCUS_FADING |
842 | pix_colors = pix_colors_focused; |
847 | pix_colors = pix_colors_focused; |
… | |
… | |
1059 | Window top, parent; |
1064 | Window top, parent; |
1060 | |
1065 | |
1061 | dLocal (Display *, dpy); |
1066 | dLocal (Display *, dpy); |
1062 | |
1067 | |
1063 | /* grab colors before netscape does */ |
1068 | /* grab colors before netscape does */ |
1064 | Get_Colours (); |
1069 | get_colours (); |
1065 | |
1070 | |
1066 | if (!set_fonts ()) |
1071 | if (!set_fonts ()) |
1067 | rxvt_fatal ("unable to load base fontset, please specify a valid one using -fn, aborting.\n"); |
1072 | rxvt_fatal ("unable to load base fontset, please specify a valid one using -fn, aborting.\n"); |
1068 | |
1073 | |
1069 | parent = display->root; |
1074 | parent = display->root; |
… | |
… | |
1524 | signal (SIGTSTP, SIG_IGN); |
1529 | signal (SIGTSTP, SIG_IGN); |
1525 | signal (SIGTTIN, SIG_IGN); |
1530 | signal (SIGTTIN, SIG_IGN); |
1526 | signal (SIGTTOU, SIG_IGN); |
1531 | signal (SIGTTOU, SIG_IGN); |
1527 | #endif /* SIGTSTP */ |
1532 | #endif /* SIGTSTP */ |
1528 | |
1533 | |
1529 | // unblock signals (signals are blocked by iom.C |
|
|
1530 | sigset_t ss; |
|
|
1531 | sigemptyset (&ss); |
|
|
1532 | sigprocmask (SIG_SETMASK, &ss, 0); |
|
|
1533 | |
|
|
1534 | /* command interpreter path */ |
1534 | /* command interpreter path */ |
1535 | if (argv) |
1535 | if (argv) |
1536 | { |
1536 | { |
1537 | # ifdef DEBUG_CMD |
1537 | # ifdef DEBUG_CMD |
1538 | int i; |
1538 | int i; |