… | |
… | |
906 | /*----------------------------------------------------------------------*/ |
906 | /*----------------------------------------------------------------------*/ |
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; |
|
|
912 | char *env_term; |
911 | |
913 | |
912 | #ifdef DISPLAY_IS_IP |
914 | #ifdef DISPLAY_IS_IP |
913 | /* Fixup display_name for export over pty to any interested terminal |
915 | /* Fixup display_name for export over pty to any interested terminal |
914 | * clients via "ESC[7n" (e.g. shells). Note we use the pure IP number |
916 | * clients via "ESC[7n" (e.g. shells). Note we use the pure IP number |
915 | * (for the first non-loopback interface) that we get from |
917 | * (for the first non-loopback interface) that we get from |
… | |
… | |
1474 | CWColormap | CWBackPixel | CWBorderPixel | CWOverrideRedirect, |
1476 | CWColormap | CWBackPixel | CWBorderPixel | CWOverrideRedirect, |
1475 | &attributes); |
1477 | &attributes); |
1476 | |
1478 | |
1477 | this->parent = top; |
1479 | this->parent = top; |
1478 | |
1480 | |
1479 | old_width = szHint.width; |
|
|
1480 | old_height = szHint.height; |
|
|
1481 | |
|
|
1482 | set_title (rs [Rs_title]); |
1481 | set_title (rs [Rs_title]); |
1483 | set_icon_name (rs [Rs_iconName]); |
1482 | set_icon_name (rs [Rs_iconName]); |
1484 | |
1483 | |
1485 | classHint.res_name = (char *)rs[Rs_name]; |
1484 | classHint.res_name = (char *)rs[Rs_name]; |
1486 | classHint.res_class = (char *)RESCLASS; |
1485 | classHint.res_class = (char *)RESCLASS; |
… | |
… | |
1676 | |
1675 | |
1677 | _exit (EXIT_FAILURE); |
1676 | _exit (EXIT_FAILURE); |
1678 | |
1677 | |
1679 | default: |
1678 | default: |
1680 | if (!option (Opt_utmpInhibit)) |
1679 | if (!option (Opt_utmpInhibit)) |
|
|
1680 | { |
|
|
1681 | #ifdef LOG_ONLY_ON_LOGIN |
|
|
1682 | bool login_shell = option (Opt_loginShell); |
|
|
1683 | #else |
|
|
1684 | bool login_shell = true; |
|
|
1685 | #endif |
1681 | pty->login (cmd_pid, option (Opt_loginShell), rs[Rs_display_name]); |
1686 | pty->login (cmd_pid, login_shell, rs[Rs_display_name]); |
|
|
1687 | } |
1682 | |
1688 | |
1683 | pty->close_tty (); |
1689 | pty->close_tty (); |
1684 | |
1690 | |
1685 | child_ev.start (cmd_pid); |
1691 | child_ev.start (cmd_pid); |
1686 | |
1692 | |
… | |
… | |
1711 | #elif defined (SRIOCSREDIR) |
1717 | #elif defined (SRIOCSREDIR) |
1712 | int fd; |
1718 | int fd; |
1713 | |
1719 | |
1714 | fd = open (CONSOLE, O_WRONLY, 0); |
1720 | fd = open (CONSOLE, O_WRONLY, 0); |
1715 | if (fd >= 0) |
1721 | if (fd >= 0) |
1716 | if (ioctl (fd, SRIOCSREDIR, NULL) < 0) |
1722 | { |
|
|
1723 | ioctl (fd, SRIOCSREDIR, STDIN_FILENO); |
1717 | close (fd); |
1724 | close (fd); |
|
|
1725 | } |
1718 | #endif /* SRIOCSREDIR */ |
1726 | #endif /* SRIOCSREDIR */ |
1719 | } |
1727 | } |
1720 | |
1728 | |
1721 | /* reset signals and spin off the command interpreter */ |
1729 | /* reset signals and spin off the command interpreter */ |
1722 | signal (SIGINT, SIG_DFL); |
1730 | signal (SIGINT, SIG_DFL); |