… | |
… | |
38 | #include "init.h" |
38 | #include "init.h" |
39 | #include "keyboard.h" |
39 | #include "keyboard.h" |
40 | |
40 | |
41 | #include <limits> |
41 | #include <limits> |
42 | |
42 | |
43 | #include <csignal> |
43 | #include <signal.h> |
44 | |
44 | |
45 | #include <fcntl.h> |
45 | #include <fcntl.h> |
46 | |
46 | |
47 | #ifdef HAVE_XSETLOCALE |
47 | #ifdef HAVE_XSETLOCALE |
48 | # define X_LOCALE |
48 | # define X_LOCALE |
49 | # include <X11/Xlocale.h> |
49 | # include <X11/Xlocale.h> |
50 | #else |
50 | #else |
51 | # ifdef HAVE_SETLOCALE |
51 | # ifdef HAVE_SETLOCALE |
52 | # include <clocale> |
52 | # include <locale.h> |
53 | # endif |
53 | # endif |
54 | #endif |
54 | #endif |
55 | |
55 | |
56 | #ifdef HAVE_NL_LANGINFO |
56 | #ifdef HAVE_NL_LANGINFO |
57 | # include <langinfo.h> |
57 | # include <langinfo.h> |
… | |
… | |
852 | |
852 | |
853 | #if ENABLE_PERL |
853 | #if ENABLE_PERL |
854 | rootwin_ev.start (display, display->root); |
854 | rootwin_ev.start (display, display->root); |
855 | #endif |
855 | #endif |
856 | |
856 | |
857 | set_colorfgbg (); |
857 | init_done = 1; |
858 | |
858 | |
859 | init_command (cmd_argv); |
859 | init_command (cmd_argv); |
860 | |
860 | |
861 | if (pty->pty >= 0) |
861 | if (pty->pty >= 0) |
862 | pty_ev.start (pty->pty, ev::READ); |
862 | pty_ev.start (pty->pty, ev::READ); |
… | |
… | |
907 | void |
907 | void |
908 | rxvt_term::init_env () |
908 | rxvt_term::init_env () |
909 | { |
909 | { |
910 | char *val; |
910 | char *val; |
911 | char *env_display; |
911 | char *env_display; |
|
|
912 | char *env_windowid; |
|
|
913 | char *env_colorfgbg; |
912 | char *env_term; |
914 | char *env_term; |
913 | |
915 | |
914 | #ifdef DISPLAY_IS_IP |
916 | #ifdef DISPLAY_IS_IP |
915 | /* Fixup display_name for export over pty to any interested terminal |
917 | /* Fixup display_name for export over pty to any interested terminal |
916 | * clients via "ESC[7n" (e.g. shells). Note we use the pure IP number |
918 | * clients via "ESC[7n" (e.g. shells). Note we use the pure IP number |
… | |
… | |
934 | |
936 | |
935 | env_display = (char *)rxvt_malloc (strlen (val) + 9); |
937 | env_display = (char *)rxvt_malloc (strlen (val) + 9); |
936 | |
938 | |
937 | sprintf (env_display, "DISPLAY=%s", val); |
939 | sprintf (env_display, "DISPLAY=%s", val); |
938 | |
940 | |
|
|
941 | env_windowid = (char *)rxvt_malloc (21); |
939 | sprintf (env_windowid, "WINDOWID=%lu", (unsigned long)parent); |
942 | sprintf (env_windowid, "WINDOWID=%lu", (unsigned long)parent); |
940 | |
943 | |
941 | /* add entries to the environment: |
944 | /* add entries to the environment: |
942 | * @ DISPLAY: in case we started with -display |
945 | * @ DISPLAY: in case we started with -display |
943 | * @ WINDOWID: X window id number of the window |
946 | * @ WINDOWID: X window id number of the window |
… | |
… | |
947 | * @ COLORFGBG: fg;bg color codes |
950 | * @ COLORFGBG: fg;bg color codes |
948 | */ |
951 | */ |
949 | putenv (env_display); |
952 | putenv (env_display); |
950 | putenv (env_windowid); |
953 | putenv (env_windowid); |
951 | |
954 | |
952 | if (env_colorfgbg) |
955 | env_colorfgbg = get_colorfgbg (); |
953 | putenv (env_colorfgbg); |
956 | putenv (env_colorfgbg); |
954 | |
957 | |
955 | #ifdef RXVT_TERMINFO |
958 | #ifdef RXVT_TERMINFO |
956 | putenv ("TERMINFO=" RXVT_TERMINFO); |
959 | putenv ("TERMINFO=" RXVT_TERMINFO); |
957 | #endif |
960 | #endif |
958 | |
961 | |
… | |
… | |
1190 | /*----------------------------------------------------------------------*/ |
1193 | /*----------------------------------------------------------------------*/ |
1191 | /* color aliases, fg/bg bright-bold */ |
1194 | /* color aliases, fg/bg bright-bold */ |
1192 | void |
1195 | void |
1193 | rxvt_term::color_aliases (int idx) |
1196 | rxvt_term::color_aliases (int idx) |
1194 | { |
1197 | { |
1195 | if (rs[Rs_color + idx] && isdigit (* (rs[Rs_color + idx]))) |
1198 | if (rs[Rs_color + idx] && isdigit (*rs[Rs_color + idx])) |
1196 | { |
1199 | { |
1197 | int i = atoi (rs[Rs_color + idx]); |
1200 | int i = atoi (rs[Rs_color + idx]); |
1198 | |
1201 | |
1199 | if (i >= 8 && i <= 15) |
1202 | if (i >= 8 && i <= 15) |
1200 | /* bright colors */ |
1203 | /* bright colors */ |
… | |
… | |
1547 | TermWin_cursor = XCreateFontCursor (dpy, XC_xterm); |
1550 | TermWin_cursor = XCreateFontCursor (dpy, XC_xterm); |
1548 | |
1551 | |
1549 | /* the vt window */ |
1552 | /* the vt window */ |
1550 | vt = XCreateSimpleWindow (dpy, top, |
1553 | vt = XCreateSimpleWindow (dpy, top, |
1551 | window_vt_x, window_vt_y, |
1554 | window_vt_x, window_vt_y, |
1552 | width, height, |
1555 | vt_width, vt_height, |
1553 | 0, |
1556 | 0, |
1554 | pix_colors_focused[Color_fg], |
1557 | pix_colors_focused[Color_fg], |
1555 | pix_colors_focused[Color_bg]); |
1558 | pix_colors_focused[Color_bg]); |
1556 | |
1559 | |
1557 | attributes.bit_gravity = NorthWestGravity; |
1560 | attributes.bit_gravity = NorthWestGravity; |