aboutsummaryrefslogtreecommitdiff
path: root/window.c
diff options
context:
space:
mode:
Diffstat (limited to 'window.c')
-rw-r--r--window.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/window.c b/window.c
index 117c47e7..eea67b31 100644
--- a/window.c
+++ b/window.c
@@ -29,8 +29,6 @@
#include <termios.h>
#include <time.h>
#include <unistd.h>
-#include <util.h>
-#include <vis.h>
#include "tmux.h"
@@ -848,6 +846,9 @@ window_pane_destroy(struct window_pane *wp)
free(wp->searchstr);
if (wp->fd != -1) {
+#ifdef HAVE_UTEMPTER
+ utempter_remove_record(wp->fd);
+#endif
bufferevent_free(wp->event);
close(wp->fd);
}
@@ -884,6 +885,9 @@ window_pane_spawn(struct window_pane *wp, int argc, char **argv,
char *argv0, *cmd, **argvp;
const char *ptr, *first, *home;
struct termios tio2;
+#ifdef HAVE_UTEMPTER
+ char s[32];
+#endif
sigset_t set, oldset;
if (wp->fd != -1) {
@@ -945,6 +949,9 @@ window_pane_spawn(struct window_pane *wp, int argc, char **argv,
if (tio != NULL)
memcpy(tio2.c_cc, tio->c_cc, sizeof tio2.c_cc);
tio2.c_cc[VERASE] = '\177';
+#ifdef IUTF8
+ tio2.c_iflag |= IUTF8;
+#endif
if (tcsetattr(STDIN_FILENO, TCSANOW, &tio2) != 0)
fatal("tcgetattr failed");
@@ -992,6 +999,12 @@ window_pane_spawn(struct window_pane *wp, int argc, char **argv,
log_debug("%s: master=%s", __func__, ttyname(wp->fd));
log_debug("%s: slave=%s", __func__, wp->tty);
+#ifdef HAVE_UTEMPTER
+ xsnprintf(s, sizeof s, "tmux(%lu).%%%u", (long) getpid(), wp->id);
+ utempter_add_record(wp->fd, s);
+ kill(getpid(), SIGCHLD);
+#endif
+
sigprocmask(SIG_SETMASK, &oldset, NULL);
setblocking(wp->fd, 0);