Trim spaces.

This commit is contained in:
Nicholas Marriott 2009-01-10 01:51:22 +00:00
parent 430d219436
commit a1b43faa43
26 changed files with 97 additions and 97 deletions

View File

@ -93,12 +93,12 @@
(including the ability to use abbreviations).
PLEASE NOTE this includes the following configuration-breaking changes:
- remain-by-default is now GONE, use "setw -g remain-on-exit" to apply the
global window option instead;
- mode-keys is now a window option rather than session - use "setw [-g]
mode-keys" instead of set.
There are also some additions:
- message-fg and message-bg session options to control status line message
@ -838,7 +838,7 @@
(including mutt, emacs). No status bar yet and no key remapping or other
customisation.
$Id: CHANGES,v 1.186 2009-01-10 01:30:38 nicm Exp $
$Id: CHANGES,v 1.187 2009-01-10 01:51:21 nicm Exp $
LocalWords: showw utf UTF fulvio ciriaco joshe OSC APC gettime abc DEF OA clr
LocalWords: rivo nurges lscm Erdely eol smysession mysession ek dstname RB

View File

@ -1,4 +1,4 @@
/* $Id: cmd-generic.c,v 1.16 2009-01-07 19:53:17 nicm Exp $ */
/* $Id: cmd-generic.c,v 1.17 2009-01-10 01:51:21 nicm Exp $ */
/*
* Copyright (c) 2008 Nicholas Marriott <nicm@users.sourceforge.net>
@ -65,7 +65,7 @@ cmd_print_flags(char *buf, size_t len, size_t off, int flags)
{
if ((flags & (CMD_DFLAG|CMD_GFLAG|CMD_KFLAG|CMD_UFLAG)) == 0)
return (0);
off += xsnprintf(buf + off, len - off, " -");
off += xsnprintf(buf + off, len - off, " -");
if (off < len && flags & CMD_DFLAG)
off += xsnprintf(buf + off, len - off, "d");
if (off < len && flags & CMD_GFLAG)
@ -96,7 +96,7 @@ cmd_fill_argument(int flags, char **arg, int argc, char **argv)
*arg = xstrdup(argv[0]);
return (0);
}
if (argc != 0)
return (-1);
return (0);

View File

@ -1,4 +1,4 @@
/* $Id: cmd-server-info.c,v 1.3 2009-01-10 01:44:35 nicm Exp $ */
/* $Id: cmd-server-info.c,v 1.4 2009-01-10 01:51:21 nicm Exp $ */
/*
* Copyright (c) 2008 Nicholas Marriott <nicm@users.sourceforge.net>
@ -53,7 +53,7 @@ cmd_server_info_exec(unused struct cmd *self, struct cmd_ctx *ctx)
u_int i;
char s[BUFSIZ];
ctx->print(ctx, "tmux " BUILD
ctx->print(ctx, "tmux " BUILD
", pid %ld, started %s", (long) getpid(), ctime(&start_time));
ctx->print(ctx, "socket path %s, debug level %d%s",
socket_path, debug_level, be_quiet ? ", quiet" : "");
@ -61,7 +61,7 @@ cmd_server_info_exec(unused struct cmd *self, struct cmd_ctx *ctx)
ctx->print(ctx, "configuration file %s", cfg_file);
else
ctx->print(ctx, "configuration file not specified");
ctx->print(ctx, "%u clients, %u sessions",
ctx->print(ctx, "%u clients, %u sessions",
ARRAY_LENGTH(&clients), ARRAY_LENGTH(&sessions));
ctx->print(ctx, "");
@ -78,7 +78,7 @@ cmd_server_info_exec(unused struct cmd *self, struct cmd_ctx *ctx)
ctx->print(ctx, "Terminals:");
SLIST_FOREACH(term, &tty_terms, entry) {
ctx->print(ctx, "%s [references=%u, flags=0x%x]:",
ctx->print(ctx, "%s [references=%u, flags=0x%x]:",
term->name, term->references, term->flags);
for (i = 0; i < NTTYCODE; i++) {
ent = &tty_term_codes[i];
@ -102,14 +102,14 @@ cmd_server_info_exec(unused struct cmd *self, struct cmd_ctx *ctx)
break;
case TTYCODE_FLAG:
ctx->print(ctx, " %2d,%s: (flag) %s",
ent->code, ent->name,
ent->code, ent->name,
code->value.flag ? "true" : "false");
break;
}
}
}
ctx->print(ctx, "");
ctx->print(ctx, "");
if (cmdclient != NULL)
server_write_client(cmdclient, MSG_EXIT, NULL, 0);
}

View File

@ -1,4 +1,4 @@
/* $Id: cmd-set-option.c,v 1.48 2009-01-07 19:53:17 nicm Exp $ */
/* $Id: cmd-set-option.c,v 1.49 2009-01-10 01:51:21 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@ -110,7 +110,7 @@ cmd_set_option_exec(struct cmd *self, struct cmd_ctx *ctx)
if (data->flags & CMD_UFLAG) {
if (data->flags & CMD_GFLAG) {
ctx->error(ctx,
ctx->error(ctx,
"can't unset global option: %s", entry->name);
return;
}
@ -148,7 +148,7 @@ cmd_set_option_exec(struct cmd *self, struct cmd_ctx *ctx)
break;
}
}
recalculate_sizes();
for (i = 0; i < ARRAY_LENGTH(&clients); i++) {
c = ARRAY_ITEM(&clients, i);

View File

@ -1,4 +1,4 @@
/* $Id: cmd-set-window-option.c,v 1.17 2009-01-09 16:45:58 nicm Exp $ */
/* $Id: cmd-set-window-option.c,v 1.18 2009-01-10 01:51:21 nicm Exp $ */
/*
* Copyright (c) 2008 Nicholas Marriott <nicm@users.sourceforge.net>
@ -108,7 +108,7 @@ cmd_set_window_option_exec(struct cmd *self, struct cmd_ctx *ctx)
if (data->flags & CMD_UFLAG) {
if (data->flags & CMD_GFLAG) {
ctx->error(ctx,
ctx->error(ctx,
"can't unset global option: %s", entry->name);
return;
}
@ -146,7 +146,7 @@ cmd_set_window_option_exec(struct cmd *self, struct cmd_ctx *ctx)
break;
}
}
recalculate_sizes();
for (i = 0; i < ARRAY_LENGTH(&clients); i++) {
c = ARRAY_ITEM(&clients, i);

View File

@ -1,4 +1,4 @@
/* $Id: cmd-string.c,v 1.9 2008-12-10 19:50:35 nicm Exp $ */
/* $Id: cmd-string.c,v 1.10 2009-01-10 01:51:21 nicm Exp $ */
/*
* Copyright (c) 2008 Nicholas Marriott <nicm@users.sourceforge.net>
@ -133,7 +133,7 @@ cmd_string_parse(const char *s, struct cmd **cmd, char **cause)
if ((*cmd = cmd_parse(argc, argv, cause)) == NULL)
goto out;
rval = 0;
goto out;
default:

4
cmd.c
View File

@ -1,4 +1,4 @@
/* $Id: cmd.c,v 1.69 2009-01-10 01:30:38 nicm Exp $ */
/* $Id: cmd.c,v 1.70 2009-01-10 01:51:21 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@ -109,7 +109,7 @@ cmd_parse(int argc, char **argv, char **cause)
xasprintf(cause, "unknown command: %s", argv[0]);
return (NULL);
}
optreset = 1;
optind = 1;
if (entry->parse == NULL) {

View File

@ -1,4 +1,4 @@
/* $Id: colour.c,v 1.2 2008-10-09 22:00:33 nicm Exp $ */
/* $Id: colour.c,v 1.3 2009-01-10 01:51:21 nicm Exp $ */
/*
* Copyright (c) 2008 Nicholas Marriott <nicm@users.sourceforge.net>
@ -78,20 +78,20 @@ colour_translate256(u_char c)
{
static const u_char table[] = {
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
0, 4, 4, 4, 12, 12, 2, 6, 4, 4, 12, 12, 2, 2, 6, 4,
12, 12, 2, 2, 2, 6, 12, 12, 10, 10, 10, 10, 14, 12, 10, 10,
10, 10, 10, 14, 1, 5, 4, 4, 12, 12, 3, 8, 4, 4, 12, 12,
2, 2, 6, 4, 12, 12, 2, 2, 2, 6, 12, 12, 10, 10, 10, 10,
14, 12, 10, 10, 10, 10, 10, 14, 1, 1, 5, 4, 12, 12, 1, 1,
5, 4, 12, 12, 3, 3, 8, 4, 12, 12, 2, 2, 2, 6, 12, 12,
10, 10, 10, 10, 14, 12, 10, 10, 10, 10, 10, 14, 1, 1, 1, 5,
12, 12, 1, 1, 1, 5, 12, 12, 1, 1, 1, 5, 12, 12, 3, 3,
3, 7, 12, 12, 10, 10, 10, 10, 14, 12, 10, 10, 10, 10, 10, 14,
9, 9, 9, 9, 13, 12, 9, 9, 9, 9, 13, 12, 9, 9, 9, 9,
13, 12, 9, 9, 9, 9, 13, 12, 11, 11, 11, 11, 7, 12, 10, 10,
10, 10, 10, 14, 9, 9, 9, 9, 9, 13, 9, 9, 9, 9, 9, 13,
9, 9, 9, 9, 9, 13, 9, 9, 9, 9, 9, 13, 9, 9, 9, 9,
9, 13, 11, 11, 11, 11, 11, 15, 0, 0, 0, 0, 0, 0, 8, 8,
0, 4, 4, 4, 12, 12, 2, 6, 4, 4, 12, 12, 2, 2, 6, 4,
12, 12, 2, 2, 2, 6, 12, 12, 10, 10, 10, 10, 14, 12, 10, 10,
10, 10, 10, 14, 1, 5, 4, 4, 12, 12, 3, 8, 4, 4, 12, 12,
2, 2, 6, 4, 12, 12, 2, 2, 2, 6, 12, 12, 10, 10, 10, 10,
14, 12, 10, 10, 10, 10, 10, 14, 1, 1, 5, 4, 12, 12, 1, 1,
5, 4, 12, 12, 3, 3, 8, 4, 12, 12, 2, 2, 2, 6, 12, 12,
10, 10, 10, 10, 14, 12, 10, 10, 10, 10, 10, 14, 1, 1, 1, 5,
12, 12, 1, 1, 1, 5, 12, 12, 1, 1, 1, 5, 12, 12, 3, 3,
3, 7, 12, 12, 10, 10, 10, 10, 14, 12, 10, 10, 10, 10, 10, 14,
9, 9, 9, 9, 13, 12, 9, 9, 9, 9, 13, 12, 9, 9, 9, 9,
13, 12, 9, 9, 9, 9, 13, 12, 11, 11, 11, 11, 7, 12, 10, 10,
10, 10, 10, 14, 9, 9, 9, 9, 9, 13, 9, 9, 9, 9, 9, 13,
9, 9, 9, 9, 9, 13, 9, 9, 9, 9, 9, 13, 9, 9, 9, 9,
9, 13, 11, 11, 11, 11, 11, 15, 0, 0, 0, 0, 0, 0, 8, 8,
8, 8, 8, 8, 7, 7, 7, 7, 7, 7, 15, 15, 15, 15, 15, 15
};

View File

@ -74,5 +74,5 @@ extern int optreset;
extern char *suboptarg; /* getsubopt(3) external variable */
#endif
__END_DECLS
#endif /* !_GETOPT_H_ */

View File

@ -1,4 +1,4 @@
/* $Id: grid-view.c,v 1.5 2009-01-05 11:04:06 nicm Exp $ */
/* $Id: grid-view.c,v 1.6 2009-01-10 01:51:21 nicm Exp $ */
/*
* Copyright (c) 2008 Nicholas Marriott <nicm@users.sourceforge.net>
@ -178,7 +178,7 @@ grid_view_insert_cells(struct grid_data *gd, u_int px, u_int py, u_int nx)
py = grid_view_y(gd, py);
sx = grid_view_x(gd, gd->sx);
if (px == sx - 1)
grid_clear(gd, px, py, 1, 1);
else

4
grid.c
View File

@ -1,4 +1,4 @@
/* $Id: grid.c,v 1.4 2009-01-08 21:52:05 nicm Exp $ */
/* $Id: grid.c,v 1.5 2009-01-10 01:51:21 nicm Exp $ */
/*
* Copyright (c) 2008 Nicholas Marriott <nicm@users.sourceforge.net>
@ -350,7 +350,7 @@ grid_move_cells(struct grid_data *gd, u_int dx, u_int px, u_int py, u_int nx)
return;
grid_check_x(gd, px);
grid_check_x(gd, px + nx - 1);
grid_check_x(gd, px + nx - 1);
grid_check_x(gd, dx + nx - 1);
grid_check_y(gd, py);

View File

@ -1,4 +1,4 @@
/* $Id: input-keys.c,v 1.18 2009-01-09 16:45:58 nicm Exp $ */
/* $Id: input-keys.c,v 1.19 2009-01-10 01:51:21 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@ -128,7 +128,7 @@ input_key(struct window *w, int key)
if ((ike->flags & INPUTKEY_CURSOR) &&
!(w->screen->mode & MODE_KCURSOR))
continue;
if (ike->flags & INPUTKEY_MODIFIER) {
if (KEYC_ISCTL(key) && KEYC_ADDCTL(ike->key) == key)
break;
@ -148,7 +148,7 @@ input_key(struct window *w, int key)
log_debug2("found key 0x%x: \"%s\"", key, ike->data);
if (ike->flags & INPUTKEY_XTERM &&
if (ike->flags & INPUTKEY_XTERM &&
options_get_number(&w->options, "xterm-keys")) {
/* In xterm keys mode, append modifier argument. */
ch = '\0';
@ -177,9 +177,9 @@ input_key(struct window *w, int key)
return;
}
if (ike->flags & INPUTKEY_MODIFIER) {
/*
/*
* If not in xterm keys or not an xterm key handle escape and
* control (shift not supported).
* control (shift not supported).
*/
if (KEYC_ISESC(key))
buffer_write8(w->out, '\033');

12
input.c
View File

@ -1,4 +1,4 @@
/* $Id: input.c,v 1.71 2009-01-08 21:22:01 nicm Exp $ */
/* $Id: input.c,v 1.72 2009-01-10 01:51:22 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@ -498,7 +498,7 @@ input_state_string_escape(u_char ch, struct input_ctx *ictx)
xfree(s);
return;
}
screen_set_title(ictx->ctx.s, s + 2);
screen_set_title(ictx->ctx.s, s + 2);
server_status_window(ictx->w);
xfree(s);
break;
@ -652,7 +652,7 @@ input_handle_private_two(u_char ch, struct input_ctx *ictx)
switch (ch) {
case '0': /* Dscs (graphics) */
/*
/*
* Not really supported, but fake it up enough for those that
* use it to switch character sets (by redefining G0 to
* graphics set, rather than switching to G1).
@ -695,7 +695,7 @@ input_handle_standard_two(u_char ch, struct input_ctx *ictx)
switch (ch) {
case 'B': /* Dscs (ASCII) */
/*
/*
* Not really supported, but fake it up enough for those that
* use it to switch character sets (by redefining G0 to
* graphics set, rather than switching to G1).
@ -751,9 +751,9 @@ input_handle_sequence(u_char ch, struct input_ctx *ictx)
if (*iarg->data != '\0')
log_debug2(" ++ %u: %s", i, iarg->data);
}
find.ch = ch;
entry = bsearch(&find,
entry = bsearch(&find,
input_sequence_table, nitems(input_sequence_table),
sizeof input_sequence_table[0], input_sequence_cmp);
if (entry != NULL)

View File

@ -1,4 +1,4 @@
/* $Id: options-cmd.c,v 1.2 2009-01-07 19:53:17 nicm Exp $ */
/* $Id: options-cmd.c,v 1.3 2009-01-10 01:51:22 nicm Exp $ */
/*
* Copyright (c) 2008 Nicholas Marriott <nicm@users.sourceforge.net>
@ -122,7 +122,7 @@ set_option_flag(struct cmd_ctx *ctx, struct options *oo,
}
options_set_number(oo, entry->name, flag);
ctx->info(ctx,
ctx->info(ctx,
"set option: %s -> %s", entry->name, flag ? "on" : "off");
}

View File

@ -1,4 +1,4 @@
/* $Id: screen-write.c,v 1.22 2009-01-09 23:57:42 nicm Exp $ */
/* $Id: screen-write.c,v 1.23 2009-01-10 01:51:22 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@ -210,7 +210,7 @@ void
screen_write_insertcharacter(struct screen_write_ctx *ctx, u_int nx)
{
struct screen *s = ctx->s;
if (nx == 0)
nx = 1;
@ -320,7 +320,7 @@ screen_write_clearendofline(struct screen_write_ctx *ctx)
if (s->cx <= sx - 1)
grid_view_clear(s->grid, s->cx, s->cy, sx - s->cx, 1);
if (ctx->write != NULL)
ctx->write(ctx->data, TTY_CLEARENDOFLINE);
}

View File

@ -1,4 +1,4 @@
/* $Id: screen.c,v 1.77 2008-12-08 16:19:51 nicm Exp $ */
/* $Id: screen.c,v 1.78 2009-01-10 01:51:22 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@ -183,7 +183,7 @@ screen_resize_y(struct screen *s, u_int sy)
/* Set selection. */
void
screen_set_selection(struct screen *s,
screen_set_selection(struct screen *s,
u_int sx, u_int sy, u_int ex, u_int ey, struct grid_cell *gc)
{
struct screen_sel *sel = &s->sel;

View File

@ -1,4 +1,4 @@
/* $Id: server.c,v 1.90 2009-01-10 01:30:38 nicm Exp $ */
/* $Id: server.c,v 1.91 2009-01-10 01:51:22 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@ -392,7 +392,7 @@ server_check_timers(struct client *c)
server_clear_client_message(c);
if (c->message_string != NULL || c->prompt_string != NULL) {
/*
/*
* Don't need timed redraw for messages/prompts so bail now.
* The status timer isn't reset when they are redrawn anyway.
*/

View File

@ -1,4 +1,4 @@
/* $Id: status.c,v 1.57 2009-01-08 22:28:02 nicm Exp $ */
/* $Id: status.c,v 1.58 2009-01-10 01:51:22 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@ -276,7 +276,7 @@ status_replace(struct session *s, char *fmt, time_t t)
char in[BUFSIZ], ch, *iptr, *optr, *ptr, *endptr;
size_t len;
long n;
strftime(in, sizeof in, fmt, localtime(&t));
in[(sizeof in) - 1] = '\0';
@ -504,7 +504,7 @@ status_prompt_key(struct client *c, int key)
case '\011':
if (*c->prompt_buffer == '\0')
break;
idx = c->prompt_index;
if (idx != 0)
idx--;
@ -638,7 +638,7 @@ status_prompt_add_history(struct client *c)
if (ARRAY_LENGTH(&c->prompt_hdata) > 0 &&
strcmp(ARRAY_LAST(&c->prompt_hdata), c->prompt_buffer) == 0)
return;
if (ARRAY_LENGTH(&c->prompt_hdata) == PROMPT_HISTORY) {
xfree(ARRAY_FIRST(&c->prompt_hdata));
ARRAY_REMOVE(&c->prompt_hdata, 0);
@ -677,13 +677,13 @@ status_prompt_complete(const char *s)
if (strncmp(optent->name, s, strlen(s)) == 0)
ARRAY_ADD(&list, optent->name);
}
/* If none, bail now. */
if (ARRAY_LENGTH(&list) == 0) {
ARRAY_FREE(&list);
return (NULL);
}
/* If an exact match, return it, with a trailing space. */
if (ARRAY_LENGTH(&list) == 1) {
xasprintf(&s2, "%s ", ARRAY_FIRST(&list));

8
tmux.1
View File

@ -1,4 +1,4 @@
.\" $Id: tmux.1,v 1.55 2009-01-07 23:09:51 nicm Exp $
.\" $Id: tmux.1,v 1.56 2009-01-10 01:51:22 nicm Exp $
.\"
.\" Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
.\"
@ -706,7 +706,7 @@ to the left of the status bar.
will be passed through
.Xr strftime 3
before being used.
By default, nothing is displayed.
By default, nothing is displayed.
.Ar string
may contain any of the following special character pairs:
.Bl -column "Character pair" "Replaced with" -offset indent
@ -732,7 +732,7 @@ As with
.Ic status-left ,
.Ar string
will be passed to
.Xr strftime 3
.Xr strftime 3
and character pairs are replaced.
.It Ic status-right-length Ar length
Set the maximum
@ -831,7 +831,7 @@ Execute commands from
.Ar path .
.It Xo Ic start-server
.Xc
.D1 (alias: Ic start )
.D1 (alias: Ic start )
Start the
.Nm
server, if not already running, without creating any sessions.

4
tmux.c
View File

@ -1,4 +1,4 @@
/* $Id: tmux.c,v 1.87 2009-01-10 01:30:38 nicm Exp $ */
/* $Id: tmux.c,v 1.88 2009-01-10 01:51:22 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@ -239,7 +239,7 @@ main(int argc, char **argv)
options_set_number(&global_options, "message-bg", 3);
options_init(&global_window_options, NULL);
options_set_number(&global_window_options, "xterm-keys", 0);
options_set_number(&global_window_options, "monitor-activity", 0);
options_set_number(&global_window_options, "monitor-activity", 0);
options_set_number(&global_window_options, "aggressive-resize", 0);
options_set_number(&global_window_options, "remain-on-exit", 0);
options_set_number(&global_window_options, "utf8", 0);

4
tmux.h
View File

@ -1,4 +1,4 @@
/* $Id: tmux.h,v 1.213 2009-01-10 01:30:38 nicm Exp $ */
/* $Id: tmux.h,v 1.214 2009-01-10 01:51:22 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@ -840,7 +840,7 @@ struct key_binding {
int key;
struct cmd *cmd;
SPLAY_ENTRY(key_binding) entry;
SPLAY_ENTRY(key_binding) entry;
};
SPLAY_HEAD(key_bindings, key_binding);

View File

@ -1,4 +1,4 @@
/* $Id: tty-keys.c,v 1.16 2009-01-09 23:57:42 nicm Exp $ */
/* $Id: tty-keys.c,v 1.17 2009-01-10 01:51:22 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@ -54,7 +54,7 @@ struct tty_key_ent tty_keys[] = {
{ TTYC_KNP, NULL, KEYC_NPAGE, TTYKEY_MODIFIER },
{ TTYC_KPP, NULL, KEYC_PPAGE, TTYKEY_MODIFIER },
/* Arrow keys. */
/* Arrow keys. */
{ TTYC_KCUU1, NULL, KEYC_UP, TTYKEY_MODIFIER },
{ TTYC_KCUD1, NULL, KEYC_DOWN, TTYKEY_MODIFIER },
{ TTYC_KCUB1, NULL, KEYC_LEFT, TTYKEY_MODIFIER },
@ -115,7 +115,7 @@ tty_keys_add(struct tty *tty, const char *s, int key, int flags)
tk->string = xstrdup(s);
tk->key = key;
tk->flags = flags;
if (strlen(tk->string) > tty->ksize)
tty->ksize = strlen(tk->string);
RB_INSERT(tty_keys, &tty->ktree, tk);
@ -241,7 +241,7 @@ tty_keys_next(struct tty *tty, int *key)
if (tk != NULL) {
*key = tk->key;
buffer_remove(tty->in, size + 3);
switch (arg) {
case '8':
*key = KEYC_ADDSFT(*key);

View File

@ -1,4 +1,4 @@
/* $Id: tty-term.c,v 1.2 2009-01-10 01:30:38 nicm Exp $ */
/* $Id: tty-term.c,v 1.3 2009-01-10 01:51:22 nicm Exp $ */
/*
* Copyright (c) 2008 Nicholas Marriott <nicm@users.sourceforge.net>
@ -152,7 +152,7 @@ tty_term_quirks(struct tty_term *term)
term->codes[TTYC_ICH1].type = TTYCODE_STRING;
term->codes[TTYC_ICH1].value.string = xstrdup("\033[@");
}
}
}
}
struct tty_term *
@ -202,7 +202,7 @@ tty_term_find(char *name, int fd, char **cause)
memset(&term->codes, 0, sizeof term->codes);
for (i = 0; i < NTTYCODE; i++) {
ent = &tty_term_codes[i];
code = &term->codes[ent->code];
code->type = TTYCODE_NONE;
switch (ent->type) {
@ -321,7 +321,7 @@ tty_term_find(char *name, int fd, char **cause)
if (tty_term_number(term, TTYC_COLORS) == 256)
term->flags |= TERM_256COLOURS;
if (strstr(name, "256col") != NULL) /* XXX HACK */
term->flags |= TERM_256COLOURS;
term->flags |= TERM_256COLOURS;
return (term);

18
tty.c
View File

@ -1,4 +1,4 @@
/* $Id: tty.c,v 1.55 2009-01-09 23:57:42 nicm Exp $ */
/* $Id: tty.c,v 1.56 2009-01-10 01:51:22 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@ -237,7 +237,7 @@ tty_close(struct tty *tty)
if (errno != EBADF && errno != ENXIO && errno != ENOTTY)
fatal("tcsetattr failed");
} else {
tty_raw(tty,
tty_raw(tty,
tty_term_string2(tty->term, TTYC_CSR, 0, ws.ws_row - 1));
tty_raw(tty, tty_term_string(tty->term, TTYC_RMACS));
tty_raw(tty, tty_term_string(tty->term, TTYC_SGR0));
@ -246,7 +246,7 @@ tty_close(struct tty *tty)
tty_raw(tty, tty_term_string(tty->term, TTYC_RMCUP));
tty_raw(tty, tty_term_string(tty->term, TTYC_CNORM));
}
tty_term_free(tty->term);
tty_keys_free(tty);
@ -368,7 +368,7 @@ tty_cmd_cursorup(struct tty *tty, unused struct screen *s, va_list ap)
u_int ua;
ua = va_arg(ap, u_int);
tty_emulate_repeat(tty, TTYC_CUU, TTYC_CUU1, ua);
}
@ -478,7 +478,7 @@ tty_cmd_clearendofline(struct tty *tty, struct screen *s, unused va_list ap)
if (tty_term_has(tty->term, TTYC_EL))
tty_putcode(tty, TTYC_EL);
else {
else {
tty_putcode2(tty, TTYC_CUP, s->cy, s->cx);
for (i = s->cx; i < screen_size_x(s); i++)
tty_putc(tty, ' ');
@ -495,7 +495,7 @@ tty_cmd_clearstartofline(struct tty *tty, struct screen *s, unused va_list ap)
if (tty_term_has(tty->term, TTYC_EL1))
tty_putcode(tty, TTYC_EL1);
else {
else {
tty_putcode2(tty, TTYC_CUP, s->cy, 0);
for (i = 0; i < s->cx + 1; i++)
tty_putc(tty, ' ');
@ -848,8 +848,8 @@ tty_attributes_bg(struct tty *tty, const struct grid_cell *gc)
#if 0
xsnprintf(s, sizeof s, "\033[%hhum", 92 + bg);
tty_puts(tty, s);
return;
#endif
return;
#endif
bg &= 7;
}
}
@ -860,6 +860,6 @@ tty_attributes_bg(struct tty *tty, const struct grid_cell *gc)
bg = 0;
if (bg == 8)
tty_puts(tty, "\033[49m");
else
else
tty_putcode1(tty, TTYC_SETAB, bg);
}

View File

@ -10,7 +10,7 @@ main(void)
{
time_t t;
int i;
setvbuf(stdout, NULL, _IONBF, 0);
t = time(NULL);

View File

@ -1,4 +1,4 @@
/* $Id: window-copy.c,v 1.35 2008-12-11 21:10:04 nicm Exp $ */
/* $Id: window-copy.c,v 1.36 2009-01-10 01:51:22 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@ -318,7 +318,7 @@ window_copy_update_selection(struct window *w)
/* Set colours. */
memcpy(&gc, &grid_default_cell, sizeof gc);
gc.fg = options_get_number(&w->options, "mode-fg");
gc.bg = options_get_number(&w->options, "mode-bg");
gc.bg = options_get_number(&w->options, "mode-bg");
/* Find top-left of screen. */
tx = data->ox;