summaryrefslogtreecommitdiffstats
path: root/tmux.h
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2009-01-20 19:35:03 +0000
committerNicholas Marriott <nicholas.marriott@gmail.com>2009-01-20 19:35:03 +0000
commit2d15f5985930f493d6df7f58399639ae64057c4a (patch)
treeb4da4650d74f0fc50201bbf42fd8bbb220d5c289 /tmux.h
parentd4f034beb4a242e65bcd9b56536c2777d187bdc1 (diff)
Try to change the window title to match the command running it in. This is done
by reading argv[0] from the process group leader of the group that owns the tty (tcgetpgrp()). This can't be done portably so some OS-dependent code is introduced (ugh); OpenBSD, FreeBSD and Linux are supported at the moment. A new window flag, automatic-rename, is available: if this is set to off, the window name is not changed. Specifying a name with the new-window, new-session or rename-window commands will automatically set this flag to off for the window in question. To disable it entirely set the option to off globally (setw -g automatic-rename off).
Diffstat (limited to 'tmux.h')
-rw-r--r--tmux.h16
1 files changed, 14 insertions, 2 deletions
diff --git a/tmux.h b/tmux.h
index 91057801..b8c4c993 100644
--- a/tmux.h
+++ b/tmux.h
@@ -1,4 +1,4 @@
-/* $Id: tmux.h,v 1.244 2009-01-19 18:26:50 nicm Exp $ */
+/* $Id: tmux.h,v 1.245 2009-01-20 19:35:03 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -123,6 +123,9 @@ extern const char *__progname;
/* Minimum pane size. */
#define PANE_MINIMUM 4 /* includes separator line */
+/* Automatic name refresh interval, in milliseconds. */
+#define NAME_INTERVAL 100
+
/* Fatal errors. */
#define fatal(msg) log_fatal("%s: %s", __func__, msg);
#define fatalx(msg) log_fatalx("%s: %s", __func__, msg);
@@ -606,6 +609,8 @@ TAILQ_HEAD(window_panes, window_pane);
/* Window structure. */
struct window {
char *name;
+ struct timeval name_timer;
+ pid_t pgrp;
struct window_pane *active;
struct window_panes panes;
@@ -903,7 +908,7 @@ struct set_option_entry {
extern const struct set_option_entry set_option_table[];
extern const struct set_option_entry set_window_option_table[];
#define NSETOPTION 20
-#define NSETWINDOWOPTION 12
+#define NSETWINDOWOPTION 13
/* Edit keys. */
enum mode_key {
@@ -1460,6 +1465,10 @@ void printflike3 window_choose_add(
void window_choose_ready(struct window_pane *,
u_int, void (*)(void *, int), void *);
+/* names.c */
+void set_window_names(void);
+char *default_window_name(struct window *);
+
/* session.c */
extern struct sessions sessions;
void session_alert_add(struct session *, struct window *, int);
@@ -1489,6 +1498,9 @@ int utf8_width(u_int);
/* util.c */
char *section_string(char *, size_t, size_t, size_t);
+/* osdep-*.c */
+char *get_argv0(pid_t);
+
/* buffer.c */
struct buffer *buffer_create(size_t);
void buffer_destroy(struct buffer *);