summaryrefslogtreecommitdiffstats
path: root/cmd-show-messages.c
diff options
context:
space:
mode:
authornicm <nicm>2015-07-28 15:18:10 +0000
committernicm <nicm>2015-07-28 15:18:10 +0000
commitb254115acd54513cd4b5858e31afc7980e93246c (patch)
tree8fe46a5085e824b1fbe9b7f2f4f6f2e4872d5651 /cmd-show-messages.c
parentd33adc4fd0f7657ede3178c9b1f33c2d5df3c524 (diff)
Tidy up the way terminals are described and move some structs out of tmux.h.
Diffstat (limited to 'cmd-show-messages.c')
-rw-r--r--cmd-show-messages.c34
1 files changed, 4 insertions, 30 deletions
diff --git a/cmd-show-messages.c b/cmd-show-messages.c
index 2a04bd93..92ac5cc2 100644
--- a/cmd-show-messages.c
+++ b/cmd-show-messages.c
@@ -70,11 +70,8 @@ cmd_show_messages_server(struct cmd_q *cmdq)
int
cmd_show_messages_terminals(struct cmd_q *cmdq, int blank)
{
- struct tty_term *term;
- const struct tty_term_code_entry *ent;
- struct tty_code *code;
- u_int i, n;
- char out[80];
+ struct tty_term *term;
+ u_int i, n;
n = 0;
LIST_FOREACH(term, &tty_terms, entry) {
@@ -85,31 +82,8 @@ cmd_show_messages_terminals(struct cmd_q *cmdq, int blank)
cmdq_print(cmdq, "Terminal %u: %s [references=%u, flags=0x%x]:",
n, term->name, term->references, term->flags);
n++;
- for (i = 0; i < NTTYCODE; i++) {
- ent = &tty_term_codes[i];
- code = &term->codes[ent->code];
- switch (code->type) {
- case TTYCODE_NONE:
- cmdq_print(cmdq, "%4u: %s: [missing]",
- ent->code, ent->name);
- break;
- case TTYCODE_STRING:
- strnvis(out, code->value.string, sizeof out,
- VIS_OCTAL|VIS_TAB|VIS_NL);
- cmdq_print(cmdq, "%4u: %s: (string) %s",
- ent->code, ent->name, out);
- break;
- case TTYCODE_NUMBER:
- cmdq_print(cmdq, "%4u: %s: (number) %d",
- ent->code, ent->name, code->value.number);
- break;
- case TTYCODE_FLAG:
- cmdq_print(cmdq, "%4u: %s: (flag) %s",
- ent->code, ent->name,
- code->value.flag ? "true" : "false");
- break;
- }
- }
+ for (i = 0; i < tty_term_ncodes(); i++)
+ cmdq_print(cmdq, "%s", tty_term_describe(term, i));
}
return (n != 0);
}