… | |
… | |
393 | pointerBlankDelay = 2; |
393 | pointerBlankDelay = 2; |
394 | #endif |
394 | #endif |
395 | |
395 | |
396 | /* no point having a scrollbar without having any scrollback! */ |
396 | /* no point having a scrollbar without having any scrollback! */ |
397 | if (!saveLines) |
397 | if (!saveLines) |
398 | options &= ~Opt_scrollBar; |
398 | CLR_OPTION (Opt_scrollBar); |
399 | |
399 | |
400 | #ifdef PRINTPIPE |
400 | #ifdef PRINTPIPE |
401 | if (!rs[Rs_print_pipe]) |
401 | if (!rs[Rs_print_pipe]) |
402 | rs[Rs_print_pipe] = PRINTPIPE; |
402 | rs[Rs_print_pipe] = PRINTPIPE; |
403 | #endif |
403 | #endif |
… | |
… | |
446 | setup_scrollbar (rs[Rs_scrollBar_align], rs[Rs_scrollstyle], rs[Rs_scrollBar_thickness]); |
446 | setup_scrollbar (rs[Rs_scrollBar_align], rs[Rs_scrollstyle], rs[Rs_scrollBar_thickness]); |
447 | #endif |
447 | #endif |
448 | |
448 | |
449 | #ifdef XTERM_REVERSE_VIDEO |
449 | #ifdef XTERM_REVERSE_VIDEO |
450 | /* this is how xterm implements reverseVideo */ |
450 | /* this is how xterm implements reverseVideo */ |
451 | if (options & Opt_reverseVideo) |
451 | if (OPTION (Opt_reverseVideo)) |
452 | { |
452 | { |
453 | if (!rs[Rs_color + Color_fg]) |
453 | if (!rs[Rs_color + Color_fg]) |
454 | rs[Rs_color + Color_fg] = def_colorName[Color_bg]; |
454 | rs[Rs_color + Color_fg] = def_colorName[Color_bg]; |
455 | if (!rs[Rs_color + Color_bg]) |
455 | if (!rs[Rs_color + Color_bg]) |
456 | rs[Rs_color + Color_bg] = def_colorName[Color_fg]; |
456 | rs[Rs_color + Color_bg] = def_colorName[Color_fg]; |
… | |
… | |
461 | if (!rs[Rs_color + i]) |
461 | if (!rs[Rs_color + i]) |
462 | rs[Rs_color + i] = def_colorName[i]; |
462 | rs[Rs_color + i] = def_colorName[i]; |
463 | |
463 | |
464 | #ifndef XTERM_REVERSE_VIDEO |
464 | #ifndef XTERM_REVERSE_VIDEO |
465 | /* this is how we implement reverseVideo */ |
465 | /* this is how we implement reverseVideo */ |
466 | if (options & Opt_reverseVideo) |
466 | if (OPTION (Opt_reverseVideo)) |
467 | ::swap (rs[Rs_color + Color_fg], rs[Rs_color + Color_bg]); |
467 | ::swap (rs[Rs_color + Color_fg], rs[Rs_color + Color_bg]); |
468 | #endif |
468 | #endif |
469 | |
469 | |
470 | /* convenient aliases for setting fg/bg to colors */ |
470 | /* convenient aliases for setting fg/bg to colors */ |
471 | color_aliases (Color_fg); |
471 | color_aliases (Color_fg); |
… | |
… | |
648 | * Initialize the command connection. |
648 | * Initialize the command connection. |
649 | * This should be called after the X server connection is established. |
649 | * This should be called after the X server connection is established. |
650 | */ |
650 | */ |
651 | |
651 | |
652 | #ifdef META8_OPTION |
652 | #ifdef META8_OPTION |
653 | meta_char = (options & Opt_meta8 ? 0x80 : C0_ESC); |
653 | meta_char = OPTION ((Opt_meta8) ? 0x80 : C0_ESC); |
654 | #endif |
654 | #endif |
655 | |
655 | |
656 | get_ourmods (); |
656 | get_ourmods (); |
657 | |
657 | |
658 | if (!(options & Opt_scrollTtyOutput)) |
658 | if (!OPTION (Opt_scrollTtyOutput)) |
659 | priv_modes |= PrivMode_TtyOutputInh; |
659 | priv_modes |= PrivMode_TtyOutputInh; |
660 | if (options & Opt_scrollTtyKeypress) |
660 | if (OPTION (Opt_scrollTtyKeypress)) |
661 | priv_modes |= PrivMode_Keypress; |
661 | priv_modes |= PrivMode_Keypress; |
662 | if (!(options & Opt_jumpScroll)) |
662 | if (!OPTION (Opt_jumpScroll)) |
663 | priv_modes |= PrivMode_smoothScroll; |
663 | priv_modes |= PrivMode_smoothScroll; |
664 | |
664 | |
665 | #ifndef NO_BACKSPACE_KEY |
665 | #ifndef NO_BACKSPACE_KEY |
666 | if (strcmp (key_backspace, "DEC") == 0) |
666 | if (strcmp (key_backspace, "DEC") == 0) |
667 | priv_modes |= PrivMode_HaveBackSpace; |
667 | priv_modes |= PrivMode_HaveBackSpace; |
… | |
… | |
679 | priv_modes |= PrivMode_menuBar; |
679 | priv_modes |= PrivMode_menuBar; |
680 | SavedModes |= PrivMode_menuBar; |
680 | SavedModes |= PrivMode_menuBar; |
681 | } |
681 | } |
682 | |
682 | |
683 | #ifdef CURSOR_BLINK |
683 | #ifdef CURSOR_BLINK |
684 | if (options & Opt_cursorBlink) |
684 | if (OPTION (Opt_cursorBlink)) |
685 | (void)gettimeofday (&lastcursorchange, NULL); |
685 | (void)gettimeofday (&lastcursorchange, NULL); |
686 | #endif |
686 | #endif |
687 | |
687 | |
688 | run_command (argv); |
688 | run_command (argv); |
689 | } |
689 | } |
… | |
… | |
706 | continue; |
706 | continue; |
707 | |
707 | |
708 | if (!rXParseAllocColor (&xcol, rs[Rs_color + i])) |
708 | if (!rXParseAllocColor (&xcol, rs[Rs_color + i])) |
709 | { |
709 | { |
710 | #ifndef XTERM_REVERSE_VIDEO |
710 | #ifndef XTERM_REVERSE_VIDEO |
711 | if (i < 2 && (options & Opt_reverseVideo)) |
711 | if (i < 2 && OPTION (Opt_reverseVideo)) |
712 | rs[Rs_color + i] = def_colorName[!i]; |
712 | rs[Rs_color + i] = def_colorName[!i]; |
713 | else |
713 | else |
714 | #endif |
714 | #endif |
715 | rs[Rs_color + i] = def_colorName[i]; |
715 | rs[Rs_color + i] = def_colorName[i]; |
716 | |
716 | |
… | |
… | |
939 | #endif |
939 | #endif |
940 | |
940 | |
941 | assert (sizeof (xa_names) / sizeof (char *) == NUM_XA); |
941 | assert (sizeof (xa_names) / sizeof (char *) == NUM_XA); |
942 | XInternAtoms (disp, (char **)xa_names, NUM_XA, False, xa); |
942 | XInternAtoms (disp, (char **)xa_names, NUM_XA, False, xa); |
943 | |
943 | |
944 | if (options & Opt_transparent) |
944 | if (OPTION (Opt_transparent)) |
945 | { |
945 | { |
946 | XGetWindowAttributes (disp, RootWindow (disp, display->screen), &gattr); |
946 | XGetWindowAttributes (disp, RootWindow (disp, display->screen), &gattr); |
947 | display->depth = gattr.depth; // doh //TODO, per-term not per-display? |
947 | display->depth = gattr.depth; // doh //TODO, per-term not per-display? |
948 | } |
948 | } |
949 | |
949 | |
950 | #if ENABLE_FRILLS |
950 | #if ENABLE_FRILLS |
951 | if (options & Opt_borderLess) |
951 | if (OPTION (Opt_borderLess)) |
952 | { |
952 | { |
953 | prop = XInternAtom(disp, "_MOTIF_WM_INFO", True); |
953 | prop = XInternAtom(disp, "_MOTIF_WM_INFO", True); |
954 | |
954 | |
955 | if (prop == None) |
955 | if (prop == None) |
956 | { |
956 | { |
… | |
… | |
1026 | classHint.res_name = (char *)rs[Rs_name]; |
1026 | classHint.res_name = (char *)rs[Rs_name]; |
1027 | classHint.res_class = (char *)RESCLASS; |
1027 | classHint.res_class = (char *)RESCLASS; |
1028 | |
1028 | |
1029 | wmHint.flags = InputHint | StateHint | WindowGroupHint; |
1029 | wmHint.flags = InputHint | StateHint | WindowGroupHint; |
1030 | wmHint.input = True; |
1030 | wmHint.input = True; |
1031 | wmHint.initial_state = options & Opt_iconic ? IconicState : NormalState; |
1031 | wmHint.initial_state = OPTION (Opt_iconic) ? IconicState : NormalState; |
1032 | wmHint.window_group = top; |
1032 | wmHint.window_group = top; |
1033 | |
1033 | |
1034 | XmbSetWMProperties (disp, top, NULL, NULL, (char **)argv, argc, |
1034 | XmbSetWMProperties (disp, top, NULL, NULL, (char **)argv, argc, |
1035 | &szHint, &wmHint, &classHint); |
1035 | &szHint, &wmHint, &classHint); |
1036 | |
1036 | |
… | |
… | |
1094 | XChangeWindowAttributes (disp, vt, CWBitGravity, &attributes); |
1094 | XChangeWindowAttributes (disp, vt, CWBitGravity, &attributes); |
1095 | |
1095 | |
1096 | vt_emask = ExposureMask | ButtonPressMask | ButtonReleaseMask | PropertyChangeMask; |
1096 | vt_emask = ExposureMask | ButtonPressMask | ButtonReleaseMask | PropertyChangeMask; |
1097 | |
1097 | |
1098 | #ifdef POINTER_BLANK |
1098 | #ifdef POINTER_BLANK |
1099 | if (options & Opt_pointerBlank) |
1099 | if (OPTION (Opt_pointerBlank)) |
1100 | vt_emask |= PointerMotionMask; |
1100 | vt_emask |= PointerMotionMask; |
1101 | else |
1101 | else |
1102 | #endif |
1102 | #endif |
1103 | vt_emask |= Button1MotionMask | Button3MotionMask; |
1103 | vt_emask |= Button1MotionMask | Button3MotionMask; |
1104 | |
1104 | |
… | |
… | |
1131 | } |
1131 | } |
1132 | #endif |
1132 | #endif |
1133 | |
1133 | |
1134 | #ifdef XPM_BACKGROUND |
1134 | #ifdef XPM_BACKGROUND |
1135 | if (rs[Rs_backgroundPixmap] != NULL |
1135 | if (rs[Rs_backgroundPixmap] != NULL |
1136 | && ! (options & Opt_transparent)) |
1136 | && ! OPTION (Opt_transparent)) |
1137 | { |
1137 | { |
1138 | const char *p = rs[Rs_backgroundPixmap]; |
1138 | const char *p = rs[Rs_backgroundPixmap]; |
1139 | |
1139 | |
1140 | if ((p = strchr (p, ';')) != NULL) |
1140 | if ((p = strchr (p, ';')) != NULL) |
1141 | { |
1141 | { |
… | |
… | |
1526 | { |
1526 | { |
1527 | char *login; |
1527 | char *login; |
1528 | |
1528 | |
1529 | SET_TTYMODE (STDIN_FILENO, &tio); /* init terminal attributes */ |
1529 | SET_TTYMODE (STDIN_FILENO, &tio); /* init terminal attributes */ |
1530 | |
1530 | |
1531 | if (options & Opt_console) |
1531 | if (OPTION (Opt_console)) |
1532 | { /* be virtual console, fail silently */ |
1532 | { /* be virtual console, fail silently */ |
1533 | #ifdef TIOCCONS |
1533 | #ifdef TIOCCONS |
1534 | unsigned int on = 1; |
1534 | unsigned int on = 1; |
1535 | |
1535 | |
1536 | ioctl (STDIN_FILENO, TIOCCONS, &on); |
1536 | ioctl (STDIN_FILENO, TIOCCONS, &on); |
… | |
… | |
1586 | if ((shell = getenv ("SHELL")) == NULL || *shell == '\0') |
1586 | if ((shell = getenv ("SHELL")) == NULL || *shell == '\0') |
1587 | shell = "/bin/sh"; |
1587 | shell = "/bin/sh"; |
1588 | |
1588 | |
1589 | argv0 = (const char *)rxvt_r_basename (shell); |
1589 | argv0 = (const char *)rxvt_r_basename (shell); |
1590 | |
1590 | |
1591 | if (options & Opt_loginShell) |
1591 | if (OPTION (Opt_loginShell)) |
1592 | { |
1592 | { |
1593 | login = (char *)rxvt_malloc ((strlen (argv0) + 2) * sizeof (char)); |
1593 | login = (char *)rxvt_malloc ((strlen (argv0) + 2) * sizeof (char)); |
1594 | |
1594 | |
1595 | login[0] = '-'; |
1595 | login[0] = '-'; |
1596 | strcpy (&login[1], argv0); |
1596 | strcpy (&login[1], argv0); |
… | |
… | |
1631 | if ((command = getenv ("SHELL")) == NULL || *command == '\0') |
1631 | if ((command = getenv ("SHELL")) == NULL || *command == '\0') |
1632 | command = "/bin/sh"; |
1632 | command = "/bin/sh"; |
1633 | |
1633 | |
1634 | arg_a[0] = my_basename (command); |
1634 | arg_a[0] = my_basename (command); |
1635 | |
1635 | |
1636 | if (options & Opt_loginShell) |
1636 | if (OPTION (Opt_loginShell)) |
1637 | { |
1637 | { |
1638 | login = rxvt_malloc ((strlen (arg_a[0]) + 2) * sizeof (char)); |
1638 | login = rxvt_malloc ((strlen (arg_a[0]) + 2) * sizeof (char)); |
1639 | |
1639 | |
1640 | login[0] = '-'; |
1640 | login[0] = '-'; |
1641 | strcpy (&login[1], arg_a[0]); |
1641 | strcpy (&login[1], arg_a[0]); |