summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2015-11-24 21:52:07 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2015-11-24 21:52:07 +0000
commitaa7d58417b2629d9f94ae2572e2f74542c3ea214 (patch)
tree1d07bae66ab80038a25c18eb0d94b400f4bbc5a9 /usr.bin
parent2bbf3c0f8977c85ab1e26d8fc89c6065836e8e5a (diff)
Remove the -I part of show-messages which isn't really that useful; the
server start time can now be accessed with a new start_time format (use: tmux display -p '#{t:start_time}')
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/tmux/cmd-show-messages.c28
-rw-r--r--usr.bin/tmux/format.c4
-rw-r--r--usr.bin/tmux/server.c4
-rw-r--r--usr.bin/tmux/tmux.18
-rw-r--r--usr.bin/tmux/tmux.c4
-rw-r--r--usr.bin/tmux/tmux.h8
6 files changed, 18 insertions, 38 deletions
diff --git a/usr.bin/tmux/cmd-show-messages.c b/usr.bin/tmux/cmd-show-messages.c
index ea011709535..df1bd2bb094 100644
--- a/usr.bin/tmux/cmd-show-messages.c
+++ b/usr.bin/tmux/cmd-show-messages.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd-show-messages.c,v 1.15 2015/11/24 21:23:44 nicm Exp $ */
+/* $OpenBSD: cmd-show-messages.c,v 1.16 2015/11/24 21:52:06 nicm Exp $ */
/*
* Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -33,8 +33,8 @@ enum cmd_retval cmd_show_messages_exec(struct cmd *, struct cmd_q *);
const struct cmd_entry cmd_show_messages_entry = {
"show-messages", "showmsgs",
- "IJTt:", 0, 0,
- "[-IJT] " CMD_TARGET_CLIENT_USAGE,
+ "JTt:", 0, 0,
+ "[-JT] " CMD_TARGET_CLIENT_USAGE,
0,
cmd_show_messages_exec
};
@@ -47,28 +47,10 @@ const struct cmd_entry cmd_server_info_entry = {
cmd_show_messages_exec
};
-int cmd_show_messages_server(struct cmd_q *);
int cmd_show_messages_terminals(struct cmd_q *, int);
int cmd_show_messages_jobs(struct cmd_q *, int);
int
-cmd_show_messages_server(struct cmd_q *cmdq)
-{
- char *tim;
-
- tim = ctime(&start_time);
- *strchr(tim, '\n') = '\0';
-
- cmdq_print(cmdq, "started %s", tim);
- cmdq_print(cmdq, "socket path %s", socket_path);
- cmdq_print(cmdq, "protocol version %d", PROTOCOL_VERSION);
- cmdq_print(cmdq, "libevent %s (%s)", event_get_version(),
- event_get_method());
-
- return (1);
-}
-
-int
cmd_show_messages_terminals(struct cmd_q *cmdq, int blank)
{
struct tty_term *term;
@@ -118,10 +100,6 @@ cmd_show_messages_exec(struct cmd *self, struct cmd_q *cmdq)
int done, blank;
done = blank = 0;
- if (args_has(args, 'I') || self->entry == &cmd_server_info_entry) {
- blank = cmd_show_messages_server(cmdq);
- done = 1;
- }
if (args_has(args, 'T') || self->entry == &cmd_server_info_entry) {
blank = cmd_show_messages_terminals(cmdq, blank);
done = 1;
diff --git a/usr.bin/tmux/format.c b/usr.bin/tmux/format.c
index 14937cea724..de04b6f0133 100644
--- a/usr.bin/tmux/format.c
+++ b/usr.bin/tmux/format.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: format.c,v 1.99 2015/11/18 14:27:44 nicm Exp $ */
+/* $OpenBSD: format.c,v 1.100 2015/11/24 21:52:06 nicm Exp $ */
/*
* Copyright (c) 2011 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -488,6 +488,8 @@ format_create_flags(int flags)
format_add_cb(ft, "host", format_cb_host);
format_add_cb(ft, "host_short", format_cb_host_short);
format_add_cb(ft, "pid", format_cb_pid);
+ format_add(ft, "socket_path", "%s", socket_path);
+ format_add_tv(ft, "start_time", &start_time);
return (ft);
}
diff --git a/usr.bin/tmux/server.c b/usr.bin/tmux/server.c
index 657d77beca2..4ae2fb88bce 100644
--- a/usr.bin/tmux/server.c
+++ b/usr.bin/tmux/server.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: server.c,v 1.152 2015/11/24 21:19:46 nicm Exp $ */
+/* $OpenBSD: server.c,v 1.153 2015/11/24 21:52:06 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -187,7 +187,7 @@ server_start(struct event_base *base, int lockfd, char *lockfile)
mode_key_init_trees();
key_bindings_init();
- start_time = time(NULL);
+ gettimeofday(&start_time, NULL);
server_fd = server_create_socket();
if (server_fd == -1)
diff --git a/usr.bin/tmux/tmux.1 b/usr.bin/tmux/tmux.1
index cf6daf2a40e..cd9ee4d18b3 100644
--- a/usr.bin/tmux/tmux.1
+++ b/usr.bin/tmux/tmux.1
@@ -1,4 +1,4 @@
-.\" $OpenBSD: tmux.1,v 1.464 2015/11/24 21:50:06 nicm Exp $
+.\" $OpenBSD: tmux.1,v 1.465 2015/11/24 21:52:06 nicm Exp $
.\"
.\" Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
.\"
@@ -891,7 +891,7 @@ is specified, only update the client's status bar.
Rename the session to
.Ar new-name .
.It Xo Ic show-messages
-.Op Fl IJT
+.Op Fl JT
.Op Fl t Ar target-client
.Xc
.D1 (alias: Ic showmsgs )
@@ -904,11 +904,10 @@ With
.Fl t ,
display the log for
.Ar target-client .
-.Fl I ,
.Fl J
and
.Fl T
-show debugging information about the running server, jobs and terminals.
+show debugging information about jobs and terminals.
.It Ic source-file Ar path
.D1 (alias: Ic source )
Execute commands from
@@ -3414,6 +3413,7 @@ The following variables are available, where appropriate:
.It Li "session_name" Ta "#S" Ta "Name of session"
.It Li "session_width" Ta "" Ta "Width of session"
.It Li "session_windows" Ta "" Ta "Number of windows in session"
+.It Li "start_time" Ta "" Ta "Server start time"
.It Li "window_activity" Ta "" Ta "Integer time of window last activity"
.It Li "window_active" Ta "" Ta "1 if window active"
.It Li "window_bell_flag" Ta "" Ta "1 if window has bell"
diff --git a/usr.bin/tmux/tmux.c b/usr.bin/tmux/tmux.c
index af6fec24308..8a73fc510a3 100644
--- a/usr.bin/tmux/tmux.c
+++ b/usr.bin/tmux/tmux.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tmux.c,v 1.157 2015/11/24 21:19:46 nicm Exp $ */
+/* $OpenBSD: tmux.c,v 1.158 2015/11/24 21:52:06 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -44,7 +44,7 @@ struct options *global_w_options; /* window options */
struct environ *global_environ;
char *shell_cmd;
-time_t start_time;
+struct timeval start_time;
char socket_path[PATH_MAX];
__dead void usage(void);
diff --git a/usr.bin/tmux/tmux.h b/usr.bin/tmux/tmux.h
index 5da1311936e..35d5e84a8bd 100644
--- a/usr.bin/tmux/tmux.h
+++ b/usr.bin/tmux/tmux.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: tmux.h,v 1.588 2015/11/24 21:19:46 nicm Exp $ */
+/* $OpenBSD: tmux.h,v 1.589 2015/11/24 21:52:06 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -1431,9 +1431,9 @@ extern struct options *global_options;
extern struct options *global_s_options;
extern struct options *global_w_options;
extern struct environ *global_environ;
-extern char *shell_cmd;
-extern time_t start_time;
-extern char socket_path[PATH_MAX];
+extern char *shell_cmd;
+extern struct timeval start_time;
+extern char socket_path[PATH_MAX];
const char *getshell(void);
int checkshell(const char *);
int areshell(const char *);