diff options
Diffstat (limited to 'window.c')
-rw-r--r-- | window.c | 20 |
1 files changed, 16 insertions, 4 deletions
@@ -1,4 +1,4 @@ -/* $OpenBSD$ */ +/* $Id$ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -22,15 +22,12 @@ #include <errno.h> #include <fcntl.h> #include <fnmatch.h> -#include <paths.h> #include <pwd.h> #include <signal.h> -#include <stdint.h> #include <stdlib.h> #include <string.h> #include <termios.h> #include <unistd.h> -#include <util.h> #include "tmux.h" @@ -786,6 +783,9 @@ window_pane_destroy(struct window_pane *wp) evtimer_del(&wp->changes_timer); if (wp->fd != -1) { +#ifdef HAVE_UTEMPTER + utempter_remove_record(wp->fd); +#endif bufferevent_free(wp->event); close(wp->fd); } @@ -817,6 +817,9 @@ window_pane_spawn(struct window_pane *wp, const char *cmd, const char *shell, char *argv0, paneid[16]; const char *ptr; struct termios tio2; +#ifdef HAVE_UTEMPTER + char s[32]; +#endif if (wp->fd != -1) { bufferevent_free(wp->event); @@ -855,6 +858,10 @@ window_pane_spawn(struct window_pane *wp, const char *cmd, const char *shell, if (tio != NULL) memcpy(tio2.c_cc, tio->c_cc, sizeof tio2.c_cc); tio2.c_cc[VERASE] = '\177'; +#ifdef IUTF8 + if (options_get_number(&wp->window->options, "utf8")) + tio2.c_iflag |= IUTF8; +#endif if (tcsetattr(STDIN_FILENO, TCSANOW, &tio2) != 0) fatal("tcgetattr failed"); @@ -889,6 +896,11 @@ window_pane_spawn(struct window_pane *wp, const char *cmd, const char *shell, fatal("execl failed"); } +#ifdef HAVE_UTEMPTER + xsnprintf(s, sizeof s, "tmux(%lu).%%%u", (long) getpid(), wp->id); + utempter_add_record(wp->fd, s); +#endif + setblocking(wp->fd, 0); wp->event = bufferevent_new(wp->fd, |