summaryrefslogtreecommitdiffstats
path: root/window.c
diff options
context:
space:
mode:
Diffstat (limited to 'window.c')
-rw-r--r--window.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/window.c b/window.c
index 4b59f205..bbcc109c 100644
--- a/window.c
+++ b/window.c
@@ -22,14 +22,13 @@
#include <errno.h>
#include <fcntl.h>
#include <fnmatch.h>
+#include <signal.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <termios.h>
#include <time.h>
#include <unistd.h>
-#include <util.h>
-#include <vis.h>
#include "tmux.h"
@@ -832,6 +831,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);
}
@@ -868,6 +870,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
int i;
if (wp->fd != -1) {
@@ -916,6 +921,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");
@@ -961,6 +969,12 @@ window_pane_spawn(struct window_pane *wp, int argc, char **argv,
fatal("execl failed");
}
+#ifdef HAVE_UTEMPTER
+ xsnprintf(s, sizeof s, "tmux(%lu).%%%u", (long) getpid(), wp->id);
+ utempter_add_record(wp->fd, s);
+ kill(getpid(), SIGCHLD);
+#endif
+
setblocking(wp->fd, 0);
wp->event = bufferevent_new(wp->fd, window_pane_read_callback, NULL,