summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornicm <nicm>2014-04-17 07:55:43 +0000
committernicm <nicm>2014-04-17 07:55:43 +0000
commit2740490e279bac7b01f18cc39aa59a5de09e3a95 (patch)
tree664689226d287ee21d97062c53fc1ef17464dda1
parent877bdb46ed91580a3a4c430bc8c550314301352a (diff)
Remove the "info" message mechanism, this was only used for about five
mostly useless and annoying messages. Change those commands to silence on success like all the others. Still accept the -q command line flag and "quiet" server option for now.
-rw-r--r--cmd-queue.c31
-rw-r--r--cmd-run-shell.c10
-rw-r--r--cmd-select-layout.c3
-rw-r--r--cmd-set-option.c12
-rw-r--r--cmd-switch-client.c7
-rw-r--r--key-bindings.c2
-rw-r--r--options-table.c2
-rw-r--r--tmux.112
-rw-r--r--tmux.c9
-rw-r--r--tmux.h1
10 files changed, 12 insertions, 77 deletions
diff --git a/cmd-queue.c b/cmd-queue.c
index caa80afe..7bc154a0 100644
--- a/cmd-queue.c
+++ b/cmd-queue.c
@@ -86,37 +86,6 @@ cmdq_print(struct cmd_q *cmdq, const char *fmt, ...)
va_end(ap);
}
-/* Show info from command. */
-void printflike2
-cmdq_info(struct cmd_q *cmdq, const char *fmt, ...)
-{
- struct client *c = cmdq->client;
- va_list ap;
- char *msg;
-
- if (options_get_number(&global_options, "quiet"))
- return;
-
- va_start(ap, fmt);
-
- if (c == NULL)
- /* nothing */;
- else if (c->session == NULL || (c->flags & CLIENT_CONTROL)) {
- evbuffer_add_vprintf(c->stdout_data, fmt, ap);
-
- evbuffer_add(c->stdout_data, "\n", 1);
- server_push_stdout(c);
- } else {
- xvasprintf(&msg, fmt, ap);
- *msg = toupper((u_char) *msg);
- status_message_set(c, "%s", msg);
- free(msg);
- }
-
- va_end(ap);
-
-}
-
/* Show error from command. */
void printflike2
cmdq_error(struct cmd_q *cmdq, const char *fmt, ...)
diff --git a/cmd-run-shell.c b/cmd-run-shell.c
index d835e461..8799e0ab 100644
--- a/cmd-run-shell.c
+++ b/cmd-run-shell.c
@@ -161,13 +161,9 @@ cmd_run_shell_callback(struct job *job)
retcode = WTERMSIG(job->status);
xasprintf(&msg, "'%s' terminated by signal %d", cmd, retcode);
}
- if (msg != NULL) {
- if (lines == 0)
- cmdq_info(cmdq, "%s", msg);
- else
- cmd_run_shell_print(job, msg);
- free(msg);
- }
+ if (msg != NULL)
+ cmd_run_shell_print(job, msg);
+ free(msg);
}
void
diff --git a/cmd-select-layout.c b/cmd-select-layout.c
index 26d8538e..a5f5519c 100644
--- a/cmd-select-layout.c
+++ b/cmd-select-layout.c
@@ -104,7 +104,6 @@ cmd_select_layout_exec(struct cmd *self, struct cmd_q *cmdq)
else
layout = layout_set_previous(wl->window);
server_redraw_window(wl->window);
- cmdq_info(cmdq, "arranging in: %s", layout_set_name(layout));
return (CMD_RETURN_NORMAL);
}
@@ -115,7 +114,6 @@ cmd_select_layout_exec(struct cmd *self, struct cmd_q *cmdq)
if (layout != -1) {
layout = layout_set_select(wl->window, layout);
server_redraw_window(wl->window);
- cmdq_info(cmdq, "arranging in: %s", layout_set_name(layout));
return (CMD_RETURN_NORMAL);
}
@@ -126,7 +124,6 @@ cmd_select_layout_exec(struct cmd *self, struct cmd_q *cmdq)
return (CMD_RETURN_ERROR);
}
server_redraw_window(wl->window);
- cmdq_info(cmdq, "arranging in: %s", layoutname);
}
return (CMD_RETURN_NORMAL);
}
diff --git a/cmd-set-option.c b/cmd-set-option.c
index 67eb8083..3107746c 100644
--- a/cmd-set-option.c
+++ b/cmd-set-option.c
@@ -259,10 +259,6 @@ cmd_set_option_user(struct cmd *self, struct cmd_q *cmdq, const char* optstr,
return (CMD_RETURN_NORMAL);
}
options_set_string(oo, optstr, "%s", valstr);
- if (!args_has(args, 'q')) {
- cmdq_info(cmdq, "set option: %s -> %s", optstr,
- valstr);
- }
}
return (CMD_RETURN_NORMAL);
}
@@ -285,8 +281,6 @@ cmd_set_option_unset(struct cmd *self, struct cmd_q *cmdq,
}
options_remove(oo, oe->name);
- if (!args_has(args, 'q'))
- cmdq_info(cmdq, "unset option: %s", oe->name);
return (0);
}
@@ -295,9 +289,7 @@ int
cmd_set_option_set(struct cmd *self, struct cmd_q *cmdq,
const struct options_table_entry *oe, struct options *oo, const char *value)
{
- struct args *args = self->args;
struct options_entry *o;
- const char *s;
if (oe->type != OPTIONS_TABLE_FLAG && value == NULL) {
cmdq_error(cmdq, "empty value");
@@ -337,10 +329,6 @@ cmd_set_option_set(struct cmd *self, struct cmd_q *cmdq,
}
if (o == NULL)
return (-1);
-
- s = options_table_print_entry(oe, o, 0);
- if (!args_has(args, 'q'))
- cmdq_info(cmdq, "set option: %s -> %s", oe->name, s);
return (0);
}
diff --git a/cmd-switch-client.c b/cmd-switch-client.c
index 99a1ae64..872570b0 100644
--- a/cmd-switch-client.c
+++ b/cmd-switch-client.c
@@ -71,13 +71,10 @@ cmd_switch_client_exec(struct cmd *self, struct cmd_q *cmdq)
return (CMD_RETURN_ERROR);
if (args_has(args, 'r')) {
- if (c->flags & CLIENT_READONLY) {
+ if (c->flags & CLIENT_READONLY)
c->flags &= ~CLIENT_READONLY;
- cmdq_info(cmdq, "made client writable");
- } else {
+ else
c->flags |= CLIENT_READONLY;
- cmdq_info(cmdq, "made client read-only");
- }
}
tflag = args_get(args, 't');
diff --git a/key-bindings.c b/key-bindings.c
index 625ffddf..db48f9e7 100644
--- a/key-bindings.c
+++ b/key-bindings.c
@@ -212,7 +212,7 @@ key_bindings_dispatch(struct key_binding *bd, struct client *c)
readonly = 0;
}
if (!readonly && (c->flags & CLIENT_READONLY)) {
- cmdq_info(c->cmdq, "client is read-only");
+ cmdq_error(c->cmdq, "client is read-only");
return;
}
diff --git a/options-table.c b/options-table.c
index a46f5ce6..1010e84f 100644
--- a/options-table.c
+++ b/options-table.c
@@ -90,7 +90,7 @@ const struct options_table_entry server_options_table[] = {
{ .name = "quiet",
.type = OPTIONS_TABLE_FLAG,
- .default_num = 0 /* overridden in main() */
+ .default_num = 0
},
{ .name = "set-clipboard",
diff --git a/tmux.1 b/tmux.1
index df305239..6aba515f 100644
--- a/tmux.1
+++ b/tmux.1
@@ -23,7 +23,7 @@
.Sh SYNOPSIS
.Nm tmux
.Bk -words
-.Op Fl 2lCquv
+.Op Fl 2lCuv
.Op Fl c Ar shell-command
.Op Fl f Ar file
.Op Fl L Ar socket-name
@@ -168,10 +168,6 @@ server process to recreate it.
Behave as a login shell.
This flag currently has no effect and is for compatibility with other shells
when using tmux as a login shell.
-.It Fl q
-Set the
-.Ic quiet
-server option to prevent the server sending various informational messages.
.It Fl S Ar socket-path
Specify a full alternative path to the server socket.
If
@@ -2110,12 +2106,6 @@ option.
Set the number of error or information messages to save in the message log for
each client.
The default is 100.
-.It Xo Ic quiet
-.Op Ic on | off
-.Xc
-Enable or disable the display of various informational messages (see also the
-.Fl q
-command line flag).
.It Xo Ic set-clipboard
.Op Ic on | off
.Xc
diff --git a/tmux.c b/tmux.c
index 8f9e520d..fd2d5173 100644
--- a/tmux.c
+++ b/tmux.c
@@ -206,7 +206,7 @@ main(int argc, char **argv)
char in[256];
const char *home;
long long pid;
- int opt, flags, quiet, keys, session;
+ int opt, flags, keys, session;
#ifdef DEBUG
malloc_options = (char *) "AFGJPX";
@@ -214,7 +214,7 @@ main(int argc, char **argv)
setlocale(LC_TIME, "");
- quiet = flags = 0;
+ flags = 0;
label = path = NULL;
login_shell = (**argv == '-');
while ((opt = getopt(argc, argv, "2c:Cdf:lL:qS:uUv")) != -1) {
@@ -244,7 +244,6 @@ main(int argc, char **argv)
label = xstrdup(optarg);
break;
case 'q':
- quiet = 1;
break;
case 'S':
free(path);
@@ -291,11 +290,11 @@ main(int argc, char **argv)
options_init(&global_options, NULL);
options_table_populate_tree(server_options_table, &global_options);
- options_set_number(&global_options, "quiet", quiet);
options_init(&global_s_options, NULL);
options_table_populate_tree(session_options_table, &global_s_options);
- options_set_string(&global_s_options, "default-shell", "%s", getshell());
+ options_set_string(&global_s_options, "default-shell", "%s",
+ getshell());
options_init(&global_w_options, NULL);
options_table_populate_tree(window_options_table, &global_w_options);
diff --git a/tmux.h b/tmux.h
index 8964ae00..18cfbbe1 100644
--- a/tmux.h
+++ b/tmux.h
@@ -1851,7 +1851,6 @@ size_t cmd_list_print(struct cmd_list *, char *, size_t);
struct cmd_q *cmdq_new(struct client *);
int cmdq_free(struct cmd_q *);
void printflike2 cmdq_print(struct cmd_q *, const char *, ...);
-void printflike2 cmdq_info(struct cmd_q *, const char *, ...);
void printflike2 cmdq_error(struct cmd_q *, const char *, ...);
int cmdq_guard(struct cmd_q *, const char *, int);
void cmdq_run(struct cmd_q *, struct cmd_list *);