… | |
… | |
213 | |
213 | |
214 | #ifdef UTMP_SUPPORT |
214 | #ifdef UTMP_SUPPORT |
215 | privileged_utmp (RESTORE); |
215 | privileged_utmp (RESTORE); |
216 | #endif |
216 | #endif |
217 | |
217 | |
218 | pty.put (); |
218 | delete pty; pty = 0; |
219 | } |
219 | } |
220 | |
220 | |
221 | rxvt_term::~rxvt_term () |
221 | rxvt_term::~rxvt_term () |
222 | { |
222 | { |
223 | HOOK_INVOKE ((this, HOOK_DESTROY, DT_END)); |
223 | HOOK_INVOKE ((this, HOOK_DESTROY, DT_END)); |
… | |
… | |
509 | rxvt_perl.init (this); |
509 | rxvt_perl.init (this); |
510 | HOOK_INVOKE ((this, HOOK_INIT, DT_END)); |
510 | HOOK_INVOKE ((this, HOOK_INIT, DT_END)); |
511 | } |
511 | } |
512 | #endif |
512 | #endif |
513 | |
513 | |
|
|
514 | pty = rxvt_new_ptytty (); |
|
|
515 | |
514 | create_windows (argc, argv); |
516 | create_windows (argc, argv); |
515 | |
517 | |
516 | dDisp; |
518 | dDisp; |
517 | |
519 | |
518 | init_xlocale (); |
520 | init_xlocale (); |
… | |
… | |
543 | |
545 | |
544 | init_command (cmd_argv); |
546 | init_command (cmd_argv); |
545 | |
547 | |
546 | free (cmd_argv); |
548 | free (cmd_argv); |
547 | |
549 | |
548 | if (pty.pty >= 0) |
550 | if (pty->pty >= 0) |
549 | pty_ev.start (pty.pty, EVENT_READ); |
551 | pty_ev.start (pty->pty, EVENT_READ); |
550 | |
552 | |
551 | check_ev.start (); |
553 | check_ev.start (); |
552 | |
554 | |
553 | HOOK_INVOKE ((this, HOOK_START, DT_END)); |
555 | HOOK_INVOKE ((this, HOOK_START, DT_END)); |
554 | |
556 | |
… | |
… | |
717 | |
719 | |
718 | #ifdef UTMP_SUPPORT |
720 | #ifdef UTMP_SUPPORT |
719 | void |
721 | void |
720 | rxvt_term::privileged_utmp (rxvt_privaction action) |
722 | rxvt_term::privileged_utmp (rxvt_privaction action) |
721 | { |
723 | { |
722 | if (OPTION (Opt_utmpInhibit) |
724 | if (OPTION (Opt_utmpInhibit)) |
723 | || !pty.name || !*pty.name) |
|
|
724 | return; |
725 | return; |
725 | |
726 | |
726 | rxvt_privileges (RESTORE); |
727 | rxvt_privileges (RESTORE); |
727 | |
728 | |
728 | if (action == SAVE) |
729 | if (action == SAVE) |
729 | session.login (pty.name, cmd_pid, OPTION (Opt_loginShell), rs[Rs_display_name]); |
730 | pty->login (cmd_pid, OPTION (Opt_loginShell), rs[Rs_display_name]); |
730 | else |
731 | else |
731 | session.logout (); |
732 | pty->logout (); |
732 | |
733 | |
733 | rxvt_privileges (IGNORE); |
734 | rxvt_privileges (IGNORE); |
734 | } |
735 | } |
735 | #endif |
736 | #endif |
736 | |
737 | |
… | |
… | |
874 | * Called after a window size change. |
875 | * Called after a window size change. |
875 | */ |
876 | */ |
876 | void |
877 | void |
877 | rxvt_term::tt_winch () |
878 | rxvt_term::tt_winch () |
878 | { |
879 | { |
879 | if (pty.pty < 0) |
880 | if (pty->pty < 0) |
880 | return; |
881 | return; |
881 | |
882 | |
882 | struct winsize ws; |
883 | struct winsize ws; |
883 | |
884 | |
884 | ws.ws_col = ncol; |
885 | ws.ws_col = ncol; |
885 | ws.ws_row = nrow; |
886 | ws.ws_row = nrow; |
886 | ws.ws_xpixel = width; |
887 | ws.ws_xpixel = width; |
887 | ws.ws_ypixel = height; |
888 | ws.ws_ypixel = height; |
888 | (void)ioctl (pty.pty, TIOCSWINSZ, &ws); |
889 | (void)ioctl (pty->pty, TIOCSWINSZ, &ws); |
889 | |
890 | |
890 | #if 0 |
891 | #if 0 |
891 | // TIOCSWINSZ⎈ is supposed to do this automatically and correctly |
892 | // TIOCSWINSZ⎈ is supposed to do this automatically and correctly |
892 | if (cmd_pid) /* force through to the command */ |
893 | if (cmd_pid) /* force through to the command */ |
893 | kill (-cmd_pid, SIGWINCH); |
894 | kill (-cmd_pid, SIGWINCH); |