Space trimmage mega-diff.

pull/1/head
Nicholas Marriott 2009-05-04 17:58:27 +00:00
parent 59a5728527
commit 143aa718e5
50 changed files with 181 additions and 181 deletions

View File

@ -286,7 +286,7 @@
18 January 2009
* Unbreak UTF-8.
* -a flag to next-window and previous-window to select the next or previous
* -a flag to next-window and previous-window to select the next or previous
window with activity or bell. Bound to M-n and M-p.
* find-window command to search window names, titles and visible content (but
not history) for a string. If only one is found, the window is selected
@ -371,7 +371,7 @@
* Vertical window splitting. Currently can only split a window into two panes.
New split-window command splits (bound to ") and switch-pane command (bound to
o) switches between panes.
o) switches between panes.
close-pane, swap-pane commands are to follow. Also to come are pane resizing,
>2 panes, the ability to break a pane out to a full window and vice versa and
@ -390,7 +390,7 @@
* New option, lock-after-time. If there is no activity in the period specified
by this option (in seconds), tmux will lock the server. Default is 1800 (30
minutes), set to 0 to disable.
minutes), set to 0 to disable.
* Server locking. Two new commands: set-password to set a password (a
preencrypted password may be specified with -c); and lock-server to lock the
server until the password is entered. Also an additional command line flag,
@ -1243,7 +1243,7 @@
(including mutt, emacs). No status bar yet and no key remapping or other
customisation.
$Id: CHANGES,v 1.283 2009-05-04 13:20:01 nicm Exp $
$Id: CHANGES,v 1.284 2009-05-04 17:58:25 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 ms

View File

@ -1,4 +1,4 @@
# $Id: Makefile,v 1.129 2009-04-30 21:17:06 nicm Exp $
# $Id: Makefile,v 1.130 2009-05-04 17:58:25 nicm Exp $
.SUFFIXES: .c .o .y .h
.PHONY: clean update-index.html upload-index.html
@ -104,7 +104,7 @@ DISTFILES= *.[chyl] Makefile GNUmakefile *.[1-9] NOTES TODO CHANGES FAQ \
CLEANFILES= ${PROG} *.o .depend *~ ${PROG}.core *.log compat/*.o index.html
CPPFLAGS:= ${INCDIRS} ${CPPFLAGS}
CPPFLAGS:= ${INCDIRS} ${CPPFLAGS}
.c.o:
${CC} ${CPPFLAGS} ${CFLAGS} -c ${.IMPSRC} -o ${.TARGET}

2
TODO
View File

@ -55,7 +55,7 @@
window-more. what for? isnt this the same as doing it w/ splitw/neww now?
- would be nice if tmux could be the shell (tmux attach, but hard link to tmux
binary as "tmuxsh" or wrapper script?) -- problems with tty dev permissions
- support other mouse modes (highlight etc) and use it in copy mode
- support other mouse modes (highlight etc) and use it in copy mode
- set-remain-on-exit is a bit of a hack, some way to do it generically?
- set-option should be set-session-option and should be overall global options
for stuff like mode keys?

View File

@ -1,4 +1,4 @@
/* $Id: client.c,v 1.46 2009-03-31 22:20:42 nicm Exp $ */
/* $Id: client.c,v 1.47 2009-05-04 17:58:25 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@ -150,7 +150,7 @@ client_main(struct client_ctx *cctx)
client_handle_winch(cctx);
if (sigcont) {
siginit();
client_write_server(cctx, MSG_WAKEUP, NULL, 0);
client_write_server(cctx, MSG_WAKEUP, NULL, 0);
sigcont = 0;
}

View File

@ -1,4 +1,4 @@
/* $Id: clock.c,v 1.3 2009-03-27 16:59:57 nicm Exp $ */
/* $Id: clock.c,v 1.4 2009-05-04 17:58:25 nicm Exp $ */
/*
* Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net>
@ -125,7 +125,7 @@ clock_draw(struct screen_write_ctx *ctx, u_int colour, int style)
screen_write_puts(ctx, &gc, "%s", tim);
}
return;
}
}
x = (screen_size_x(s) / 2) - 3 * strlen(tim);
y = (screen_size_y(s) / 2) - 3;

View File

@ -1,4 +1,4 @@
/* $Id: cmd-attach-session.c,v 1.24 2009-01-23 16:59:14 nicm Exp $ */
/* $Id: cmd-attach-session.c,v 1.25 2009-05-04 17:58:26 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@ -45,7 +45,7 @@ cmd_attach_session_exec(struct cmd *self, struct cmd_ctx *ctx)
struct cmd_target_data *data = self->data;
struct session *s;
char *cause;
if (ctx->curclient != NULL)
return (0);

View File

@ -1,4 +1,4 @@
/* $Id: cmd-bind-key.c,v 1.20 2009-03-28 14:08:09 nicm Exp $ */
/* $Id: cmd-bind-key.c,v 1.21 2009-05-04 17:58:26 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@ -65,7 +65,7 @@ cmd_bind_key_parse(struct cmd *self, int argc, char **argv, char **cause)
case 'r':
data->can_repeat = 1;
break;
default:
default:
goto usage;
}
}

View File

@ -1,4 +1,4 @@
/* $Id: cmd-break-pane.c,v 1.1 2009-03-07 09:29:54 nicm Exp $ */
/* $Id: cmd-break-pane.c,v 1.2 2009-05-04 17:58:26 nicm Exp $ */
/*
* Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net>
@ -50,7 +50,7 @@ cmd_break_pane_exec(struct cmd *self, struct cmd_ctx *ctx)
struct window_pane *wp;
struct window *w;
char *cause;
if ((wl = cmd_find_window(ctx, data->target, &s)) == NULL)
return (-1);
if (data->pane == -1)

View File

@ -1,4 +1,4 @@
/* $Id: cmd-choose-session.c,v 1.6 2009-01-19 18:23:40 nicm Exp $ */
/* $Id: cmd-choose-session.c,v 1.7 2009-05-04 17:58:26 nicm Exp $ */
/*
* Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net>
@ -61,7 +61,7 @@ cmd_choose_session_exec(struct cmd *self, struct cmd_ctx *ctx)
if ((wl = cmd_find_window(ctx, data->target, NULL)) == NULL)
return (-1);
if (window_pane_set_mode(wl->window->active, &window_choose_mode) != 0)
return (0);

View File

@ -1,4 +1,4 @@
/* $Id: cmd-choose-window.c,v 1.8 2009-04-30 16:27:29 nicm Exp $ */
/* $Id: cmd-choose-window.c,v 1.9 2009-05-04 17:58:26 nicm Exp $ */
/*
* Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net>
@ -63,7 +63,7 @@ cmd_choose_window_exec(struct cmd *self, struct cmd_ctx *ctx)
if ((wl = cmd_find_window(ctx, data->target, NULL)) == NULL)
return (-1);
if (window_pane_set_mode(wl->window->active, &window_choose_mode) != 0)
return (0);

View File

@ -1,4 +1,4 @@
/* $Id: cmd-delete-buffer.c,v 1.4 2009-01-19 18:23:40 nicm Exp $ */
/* $Id: cmd-delete-buffer.c,v 1.5 2009-05-04 17:58:26 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@ -56,6 +56,6 @@ cmd_delete_buffer_exec(struct cmd *self, struct cmd_ctx *ctx)
ctx->error(ctx, "no buffer %d", data->buffer);
return (-1);
}
return (0);
}

View File

@ -1,4 +1,4 @@
/* $Id: cmd-find-window.c,v 1.6 2009-03-29 11:18:28 nicm Exp $ */
/* $Id: cmd-find-window.c,v 1.7 2009-05-04 17:58:26 nicm Exp $ */
/*
* Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net>
@ -70,7 +70,7 @@ cmd_find_window_exec(struct cmd *self, struct cmd_ctx *ctx)
if ((wl = cmd_find_window(ctx, data->target, NULL)) == NULL)
return (-1);
ARRAY_INIT(&list_idx);
ARRAY_INIT(&list_ctx);
@ -86,7 +86,7 @@ cmd_find_window_exec(struct cmd *self, struct cmd_ctx *ctx)
if (sres == NULL &&
strstr(wp->base.title, data->arg) == NULL)
continue;
if (sres == NULL) {
xasprintf(&sctx,
"pane %u title: \"%s\"", i - 1,
@ -96,9 +96,9 @@ cmd_find_window_exec(struct cmd *self, struct cmd_ctx *ctx)
xfree(sres);
}
}
ARRAY_ADD(&list_idx, wm->idx);
ARRAY_ADD(&list_ctx, sctx);
ARRAY_ADD(&list_ctx, sctx);
}
}
@ -123,7 +123,7 @@ cmd_find_window_exec(struct cmd *self, struct cmd_ctx *ctx)
wm = winlink_find_by_index(
&s->windows, ARRAY_ITEM(&list_idx, i));
w = wm->window;
sctx = ARRAY_ITEM(&list_ctx, i);
window_choose_add(wl->window->active,
wm->idx, "%3d: %s [%ux%u] (%u panes) %s", wm->idx, w->name,
@ -170,7 +170,7 @@ cmd_find_window_search(struct window_pane *wp, const char *searchstr)
u_int i, j, k;
buf = xmalloc(1);
for (j = 0; j < screen_size_y(&wp->base); j++) {
off = 0;
for (i = 0; i < screen_size_x(&wp->base); i++) {
@ -191,7 +191,7 @@ cmd_find_window_search(struct window_pane *wp, const char *searchstr)
while (off > 0 && buf[off - 1] == ' ')
off--;
buf[off] = '\0';
if ((s = strstr(buf, searchstr)) != NULL) {
s = section_string(buf, off, s - buf, 40);
xfree(buf);

View File

@ -1,4 +1,4 @@
/* $Id: cmd-generic.c,v 1.25 2009-04-03 17:31:44 nicm Exp $ */
/* $Id: cmd-generic.c,v 1.26 2009-05-04 17:58:26 nicm Exp $ */
/*
* Copyright (c) 2008 Nicholas Marriott <nicm@users.sourceforge.net>
@ -618,7 +618,7 @@ cmd_pane_parse(struct cmd *self, int argc, char **argv, char **cause)
goto error;
}
data->pane = n;
}
}
break;
case 't':
if (data->target == NULL)

View File

@ -1,4 +1,4 @@
/* $Id: cmd-kill-pane.c,v 1.6 2009-04-01 21:10:08 nicm Exp $ */
/* $Id: cmd-kill-pane.c,v 1.7 2009-05-04 17:58:26 nicm Exp $ */
/*
* Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net>
@ -47,7 +47,7 @@ cmd_kill_pane_exec(struct cmd *self, struct cmd_ctx *ctx)
struct cmd_pane_data *data = self->data;
struct winlink *wl;
struct window_pane *wp;
if ((wl = cmd_find_window(ctx, data->target, NULL)) == NULL)
return (-1);
if (data->pane == -1)

View File

@ -1,4 +1,4 @@
/* $Id: cmd-list-keys.c,v 1.13 2009-01-19 18:23:40 nicm Exp $ */
/* $Id: cmd-list-keys.c,v 1.14 2009-05-04 17:58:26 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@ -49,7 +49,7 @@ cmd_list_keys_exec(unused struct cmd *self, struct cmd_ctx *ctx)
SPLAY_FOREACH(bd, key_bindings, &key_bindings) {
if ((key = key_string_lookup_key(bd->key)) == NULL)
continue;
*tmp = '\0';
cmd_list_print(bd->cmdlist, tmp, sizeof tmp);
ctx->print(ctx, "%11s: %s", key, tmp);

View File

@ -1,4 +1,4 @@
/* $Id: cmd-list-windows.c,v 1.34 2009-04-30 16:27:29 nicm Exp $ */
/* $Id: cmd-list-windows.c,v 1.35 2009-05-04 17:58:26 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@ -48,7 +48,7 @@ cmd_list_windows_exec(struct cmd *self, struct cmd_ctx *ctx)
struct session *s;
struct winlink *wl;
struct window *w;
struct window_pane *wp;
struct window_pane *wp;
struct grid *gd;
u_int i;
unsigned long long size;
@ -64,7 +64,7 @@ cmd_list_windows_exec(struct cmd *self, struct cmd_ctx *ctx)
TAILQ_FOREACH(wp, &w->panes, entry) {
gd = wp->base.grid;
size = 0;
for (i = 0; i < gd->hsize; i++) {
size += gd->size[i] * sizeof **gd->data;
@ -76,9 +76,9 @@ cmd_list_windows_exec(struct cmd *self, struct cmd_ctx *ctx)
if (wp->fd != -1)
name = ttyname(wp->fd);
else
name = "unknown";
ctx->print(ctx,
" %s [%ux%u %s] [history %u/%u, %llu bytes]",
name = "unknown";
ctx->print(ctx,
" %s [%ux%u %s] [history %u/%u, %llu bytes]",
name, wp->sx, wp->sy, layout_name(w), gd->hsize,
gd->hlimit, size);
}

View File

@ -1,4 +1,4 @@
/* $Id: cmd-list.c,v 1.4 2009-04-30 21:53:32 nicm Exp $ */
/* $Id: cmd-list.c,v 1.5 2009-05-04 17:58:26 nicm Exp $ */
/*
* Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net>
@ -44,18 +44,18 @@ cmd_list_parse(int argc, char **argv, char **cause)
if (arglen > 1 && argv[i][arglen - 2] == '\\') {
argv[i][arglen - 2] = ';';
continue;
}
}
new_argc = i - lastsplit;
new_argv = argv + lastsplit;
if (arglen != 1)
new_argc++;
cmd = cmd_parse(new_argc, new_argv, cause);
if (cmd == NULL)
goto bad;
TAILQ_INSERT_TAIL(cmdlist, cmd, qentry);
lastsplit = i + 1;
}
@ -65,7 +65,7 @@ cmd_list_parse(int argc, char **argv, char **cause)
goto bad;
TAILQ_INSERT_TAIL(cmdlist, cmd, qentry);
}
return (cmdlist);
bad:
@ -125,7 +125,7 @@ void
cmd_list_free(struct cmd_list *cmdlist)
{
struct cmd *cmd;
while (!TAILQ_EMPTY(cmdlist)) {
cmd = TAILQ_FIRST(cmdlist);
TAILQ_REMOVE(cmdlist, cmd, qentry);

View File

@ -1,4 +1,4 @@
/* $Id: cmd-new-session.c,v 1.40 2009-04-01 18:21:24 nicm Exp $ */
/* $Id: cmd-new-session.c,v 1.41 2009-05-04 17:58:26 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@ -118,7 +118,7 @@ cmd_new_session_exec(struct cmd *self, struct cmd_ctx *ctx)
if (ctx->curclient != NULL)
return (0);
if (!data->flag_detached) {
if (c == NULL) {
ctx->error(ctx, "no client to attach to");

View File

@ -1,4 +1,4 @@
/* $Id: cmd-rename-window.c,v 1.26 2009-01-20 19:35:03 nicm Exp $ */
/* $Id: cmd-rename-window.c,v 1.27 2009-05-04 17:58:26 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@ -53,7 +53,7 @@ cmd_rename_window_exec(struct cmd *self, struct cmd_ctx *ctx)
xfree(wl->window->name);
wl->window->name = xstrdup(data->arg);
options_set_number(&wl->window->options, "automatic-rename", 0);
options_set_number(&wl->window->options, "automatic-rename", 0);
server_status_session(s);

View File

@ -1,4 +1,4 @@
/* $Id: cmd-resize-pane.c,v 1.2 2009-04-30 06:04:26 nicm Exp $ */
/* $Id: cmd-resize-pane.c,v 1.3 2009-05-04 17:58:26 nicm Exp $ */
/*
* Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net>
@ -69,7 +69,7 @@ cmd_resize_pane_exec(struct cmd *self, struct cmd_ctx *ctx)
const char *errstr;
struct window_pane *wp, *wq;
u_int adjust;
if ((wl = cmd_find_window(ctx, data->target, NULL)) == NULL)
return (-1);
if (wl->window->layout != 0) {

View File

@ -1,4 +1,4 @@
/* $Id: cmd-server-info.c,v 1.16 2009-04-29 22:29:20 nicm Exp $ */
/* $Id: cmd-server-info.c,v 1.17 2009-05-04 17:58:26 nicm Exp $ */
/*
* Copyright (c) 2008 Nicholas Marriott <nicm@users.sourceforge.net>
@ -67,7 +67,7 @@ cmd_server_info_exec(unused struct cmd *self, struct cmd_ctx *ctx)
tim = ctime(&start_time);
*strchr(tim, '\n') = '\0';
ctx->print(ctx,
ctx->print(ctx,
"tmux " BUILD ", pid %ld, started %s", (long) getpid(), tim);
ctx->print(ctx, "socket path %s, debug level %d%s",
socket_path, debug_level, be_quiet ? ", quiet" : "");
@ -91,8 +91,8 @@ cmd_server_info_exec(unused struct cmd *self, struct cmd_ctx *ctx)
continue;
ctx->print(ctx, "%2d: %s (%d, %d): %s [%ux%u %s] "
"[flags=0x%x/0x%x]", i, c->tty.path, c->fd, c->tty.fd,
c->session->name, c->tty.sx, c->tty.sy, c->tty.termname,
"[flags=0x%x/0x%x]", i, c->tty.path, c->fd, c->tty.fd,
c->session->name, c->tty.sx, c->tty.sy, c->tty.termname,
c->flags, c->tty.flags);
}
ctx->print(ctx, "");

View File

@ -1,4 +1,4 @@
/* $Id: cmd-split-window.c,v 1.12 2009-04-03 17:21:46 nicm Exp $ */
/* $Id: cmd-split-window.c,v 1.13 2009-05-04 17:58:26 nicm Exp $ */
/*
* Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net>
@ -171,7 +171,7 @@ cmd_split_window_exec(struct cmd *self, struct cmd_ctx *ctx)
return (-1);
}
server_redraw_window(w);
if (!data->flag_detached) {
window_set_active_pane(w, wp);
session_select(s, wl->idx);

View File

@ -1,4 +1,4 @@
/* $Id: cmd-swap-pane.c,v 1.4 2009-04-03 17:21:46 nicm Exp $ */
/* $Id: cmd-swap-pane.c,v 1.5 2009-05-04 17:58:26 nicm Exp $ */
/*
* Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net>
@ -111,7 +111,7 @@ cmd_swap_pane_parse(struct cmd *self, int argc, char **argv, char **cause)
goto error;
}
data->src = n;
}
}
break;
case 'q':
if (data->dst == -1) {
@ -124,7 +124,7 @@ cmd_swap_pane_parse(struct cmd *self, int argc, char **argv, char **cause)
}
data->flag_up = 0;
data->flag_down = 0;
break;
break;
case 'U':
data->flag_up = 1;
data->flag_down = 0;
@ -195,7 +195,7 @@ cmd_swap_pane_exec(struct cmd *self, struct cmd_ctx *ctx)
}
if (src_wp == dst_wp)
return (0);
return (0);
tmp_wp = TAILQ_PREV(dst_wp, window_panes, entry);
TAILQ_REMOVE(&w->panes, dst_wp, entry);

4
cmd.c
View File

@ -1,4 +1,4 @@
/* $Id: cmd.c,v 1.92 2009-04-30 21:17:06 nicm Exp $ */
/* $Id: cmd.c,v 1.93 2009-05-04 17:58:26 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@ -67,7 +67,7 @@ const struct cmd_entry *cmd_table[] = {
&cmd_rename_session_entry,
&cmd_rename_window_entry,
&cmd_resize_pane_entry,
&cmd_respawn_window_entry,
&cmd_respawn_window_entry,
&cmd_rotate_window_entry,
&cmd_save_buffer_entry,
&cmd_scroll_mode_entry,

10
grid.c
View File

@ -1,4 +1,4 @@
/* $Id: grid.c,v 1.15 2009-03-30 19:44:55 nicm Exp $ */
/* $Id: grid.c,v 1.16 2009-05-04 17:58:26 nicm Exp $ */
/*
* Copyright (c) 2008 Nicholas Marriott <nicm@users.sourceforge.net>
@ -375,12 +375,12 @@ grid_clear_lines(struct grid *gd, u_int py, u_int ny)
for (yy = py; yy < py + ny; yy++) {
if (gd->data[yy] != NULL) {
xfree(gd->data[yy]);
gd->data[yy] = NULL;
gd->data[yy] = NULL;
gd->size[yy] = 0;
}
if (gd->udata[yy] != NULL) {
xfree(gd->udata[yy]);
gd->udata[yy] = NULL;
gd->udata[yy] = NULL;
gd->usize[yy] = 0;
}
}
@ -413,10 +413,10 @@ grid_move_lines(struct grid *gd, u_int dy, u_int py, u_int ny)
grid_clear_lines(gd, yy, 1);
}
memmove(&gd->data[dy], &gd->data[py], ny * (sizeof *gd->data));
memmove(&gd->data[dy], &gd->data[py], ny * (sizeof *gd->data));
memmove(&gd->size[dy], &gd->size[py], ny * (sizeof *gd->size));
memmove(&gd->udata[dy], &gd->udata[py], ny * (sizeof *gd->udata));
memmove(&gd->udata[dy], &gd->udata[py], ny * (sizeof *gd->udata));
memmove(&gd->usize[dy], &gd->usize[py], ny * (sizeof *gd->usize));
/* Wipe any lines that have been moved (without freeing them). */

View File

@ -1,4 +1,4 @@
/* $Id: input-keys.c,v 1.26 2009-03-02 18:05:40 nicm Exp $ */
/* $Id: input-keys.c,v 1.27 2009-05-04 17:58:26 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@ -70,7 +70,7 @@ struct input_key_ent input_keys[] = {
{ KEYC_ADDCTL(KEYC_DOWN), "\033Ob", 0 },
{ KEYC_ADDCTL(KEYC_RIGHT), "\033Oc", 0 },
{ KEYC_ADDCTL(KEYC_LEFT), "\033Od", 0 },
{ KEYC_ADDSFT(KEYC_UP), "\033[a", 0 },
{ KEYC_ADDSFT(KEYC_DOWN), "\033[b", 0 },
{ KEYC_ADDSFT(KEYC_RIGHT), "\033[c", 0 },
@ -85,7 +85,7 @@ struct input_key_ent input_keys[] = {
{ KEYC_DOWN, "\033[B", 0 },
{ KEYC_RIGHT, "\033[C", 0 },
{ KEYC_LEFT, "\033[D", 0 },
/* Keypad keys. Keypad versions must come first. */
{ KEYC_KP0_1, "/", INPUTKEY_KEYPAD },
{ KEYC_KP0_2, "*", INPUTKEY_KEYPAD },

View File

@ -1,4 +1,4 @@
/* $Id: input.c,v 1.77 2009-04-23 21:28:45 nicm Exp $ */
/* $Id: input.c,v 1.78 2009-05-04 17:58:26 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@ -544,7 +544,7 @@ void
input_handle_character(u_char ch, struct input_ctx *ictx)
{
struct window_pane *wp = ictx->wp;
if (ch > 0x7f && options_get_number(&wp->window->options, "utf8")) {
/*
* UTF-8 sequence.

View File

@ -1,4 +1,4 @@
/* $Id: key-bindings.c,v 1.69 2009-04-30 18:39:34 nicm Exp $ */
/* $Id: key-bindings.c,v 1.70 2009-05-04 17:58:27 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@ -183,7 +183,7 @@ key_bindings_error(struct cmd_ctx *ctx, const char *fmt, ...)
void printflike2
key_bindings_print(struct cmd_ctx *ctx, const char *fmt, ...)
{
struct winlink *wl = ctx->cursession->curw;
struct winlink *wl = ctx->cursession->curw;
va_list ap;
if (wl->window->active->mode != &window_more_mode)

View File

@ -1,4 +1,4 @@
/* $Id: layout.c,v 1.5 2009-04-30 21:17:06 nicm Exp $ */
/* $Id: layout.c,v 1.6 2009-05-04 17:58:27 nicm Exp $ */
/*
* Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net>
@ -40,7 +40,7 @@ const struct {
{ "even-horizontal", layout_even_horizontal },
{ "even-vertical", layout_even_vertical },
{ "left-vertical", layout_left_vertical },
};
};
const char *
layout_name(struct window *w)
@ -92,9 +92,9 @@ void
layout_active_only(struct window *w, unused int active_changed)
{
struct window_pane *wp;
TAILQ_FOREACH(wp, &w->panes, entry) {
if (wp == w->active) {
if (wp == w->active) {
wp->flags &= ~PANE_HIDDEN;
wp->xoff = wp->yoff = 0;
window_pane_resize(wp, w->sx, w->sy);
@ -123,7 +123,7 @@ layout_even_horizontal(struct window *w, int active_changed)
n = w->sx / PANE_MINIMUM;
} else
width = w->sx / n;
/* Fit the panes. */
i = xoff = 0;
TAILQ_FOREACH(wp, &w->panes, entry) {
@ -171,7 +171,7 @@ layout_even_vertical(struct window *w, int active_changed)
n = w->sy / PANE_MINIMUM;
} else
height = w->sy / n;
/* Fit the panes. */
i = yoff = 0;
TAILQ_FOREACH(wp, &w->panes, entry) {
@ -226,7 +226,7 @@ layout_left_vertical(struct window *w, int active_changed)
n = w->sy / PANE_MINIMUM;
} else
height = w->sy / n;
/* Fit the panes. */
i = yoff = 0;
TAILQ_FOREACH(wp, &w->panes, entry) {

View File

@ -1,4 +1,4 @@
/* $Id: mode-key.c,v 1.10 2009-02-21 17:46:13 nicm Exp $ */
/* $Id: mode-key.c,v 1.11 2009-05-04 17:58:27 nicm Exp $ */
/*
* Copyright (c) 2008 Nicholas Marriott <nicm@users.sourceforge.net>
@ -132,7 +132,7 @@ mode_key_lookup_vi(struct mode_key_data *mdata, int key)
case KEYC_UP:
return (MODEKEYCMD_UP);
}
return (MODEKEYCMD_NONE);
}

10
names.c
View File

@ -1,4 +1,4 @@
/* $Id: names.c,v 1.4 2009-02-13 00:43:04 nicm Exp $ */
/* $Id: names.c,v 1.5 2009-05-04 17:58:27 nicm Exp $ */
/*
* Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net>
@ -33,7 +33,7 @@ set_window_names(void)
u_int i;
char *name, *wname;
struct timeval tv, tv2;
if (gettimeofday(&tv, NULL) != 0)
fatal("gettimeofday");
@ -49,7 +49,7 @@ set_window_names(void)
memcpy(&w->name_timer, &tv, sizeof w->name_timer);
tv2.tv_sec = 0;
tv2.tv_usec = NAME_INTERVAL * 1000L;
timeradd(&w->name_timer, &tv2, &w->name_timer);
timeradd(&w->name_timer, &tv2, &w->name_timer);
if (w->active->screen != &w->active->base)
name = NULL;
@ -88,7 +88,7 @@ parse_window_name(const char *in)
name = copy = xstrdup(in);
if (strncmp(name, "exec ", (sizeof "exec ") - 1) == 0)
name = name + (sizeof "exec ") - 1;
while (*name == ' ')
name++;
if ((ptr = strchr(name, ' ')) != NULL)
@ -99,7 +99,7 @@ parse_window_name(const char *in)
while (ptr > name && !isalnum(*ptr))
*ptr-- = '\0';
}
if (*name == '/')
name = xbasename(name);
name = xstrdup(name);

View File

@ -1,4 +1,4 @@
/* $Id: osdep-darwin.c,v 1.10 2009-04-29 23:07:35 nicm Exp $ */
/* $Id: osdep-darwin.c,v 1.11 2009-05-04 17:58:27 nicm Exp $ */
/*
* Copyright (c) 2009 Joshua Elsasser <josh@elsasser.org>
@ -33,7 +33,7 @@ osdep_get_name(int fd, unused char *tty)
int mib[4] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, 0 };
size_t size;
struct kinfo_proc kp;
if ((mib[3] = tcgetpgrp(fd)) == -1)
return (NULL);

View File

@ -1,4 +1,4 @@
/* $Id: screen-redraw.c,v 1.35 2009-05-04 13:20:02 nicm Exp $ */
/* $Id: screen-redraw.c,v 1.36 2009-05-04 17:58:27 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@ -113,7 +113,7 @@ screen_redraw_screen(struct client *c)
s = wp->screen;
sx = wp->sx;
sy = wp->sy;
/* Draw left and right borders. */
if (has_acs)
tty_putcode(tty, TTYC_SMACS);
@ -129,13 +129,13 @@ screen_redraw_screen(struct client *c)
tty_putc(&c->tty, cvert);
}
}
/* Draw top and bottom borders. */
if (wp->yoff > 0) {
tty_cursor(tty, wp->xoff, wp->yoff - 1, 0, 0);
for (i = 0; i < sx; i++)
tty_putc(tty, choriz);
}
}
if (wp->yoff + sy < tty->sy - status) {
tty_cursor(tty, wp->xoff, wp->yoff + sy, 0, 0);
for (i = 0; i < sx; i++)
@ -147,7 +147,7 @@ screen_redraw_screen(struct client *c)
/* Draw the pane. */
screen_redraw_pane(c, wp);
}
/* Draw the status line. */
screen_redraw_status(c);
}
@ -161,7 +161,7 @@ screen_redraw_pane(struct client *c, struct window_pane *wp)
for (i = 0; i < wp->sy; i++)
tty_draw_line(&c->tty, wp->screen, i, wp->xoff, wp->yoff);
}
/* Draw the status line. */
void

View File

@ -1,4 +1,4 @@
/* $Id: screen-write.c,v 1.44 2009-04-30 20:54:53 nicm Exp $ */
/* $Id: screen-write.c,v 1.45 2009-05-04 17:58:27 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@ -610,7 +610,7 @@ screen_write_cell(
grid_view_set_cell(gd, s->cx, s->cy, gc);
if (gc->flags & GRID_FLAG_UTF8)
grid_view_set_utf8(gd, s->cx, s->cy, &gu);
/* Move the cursor. */
screen_write_save(ctx);
s->cx += width;

View File

@ -1,4 +1,4 @@
/* $Id: screen.c,v 1.81 2009-03-28 20:17:29 nicm Exp $ */
/* $Id: screen.c,v 1.82 2009-05-04 17:58:27 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@ -181,7 +181,7 @@ screen_resize_y(struct screen *s, u_int sy)
gd->size[yy] = 0;
gd->data[yy] = NULL;
gd->usize[yy] = 0;
gd->udata[yy] = NULL;
gd->udata[yy] = NULL;
}
}

View File

@ -1,4 +1,4 @@
/* $Id: server-msg.c,v 1.65 2009-03-07 10:29:06 nicm Exp $ */
/* $Id: server-msg.c,v 1.66 2009-05-04 17:58:27 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@ -155,7 +155,7 @@ server_msg_fn_command(struct hdr *hdr, struct client *c)
if (data.pid != -1) {
TAILQ_FOREACH(cmd, cmdlist, qentry) {
if (cmd->entry->flags & CMD_CANTNEST) {
server_msg_fn_command_error(&ctx,
server_msg_fn_command_error(&ctx,
"sessions should be nested with care. "
"unset $TMUX to force");
cmd_list_free(cmdlist);
@ -233,12 +233,12 @@ server_msg_fn_resize(struct hdr *hdr, struct client *c)
c->tty.sy = data.sy;
if (c->tty.sy == 0)
c->tty.sy = 25;
c->tty.cx = UINT_MAX;
c->tty.cy = UINT_MAX;
c->tty.rupper = UINT_MAX;
c->tty.rlower = UINT_MAX;
recalculate_sizes();
/* Always redraw this client. */

View File

@ -1,4 +1,4 @@
/* $Id: server.c,v 1.139 2009-05-02 08:34:38 nicm Exp $ */
/* $Id: server.c,v 1.140 2009-05-04 17:58:27 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@ -186,7 +186,7 @@ server_start(char *path)
strlcpy(rpathbuf, socket_path, sizeof rpathbuf);
setproctitle("server (%s)", rpathbuf);
#endif
memset(&sa, 0, sizeof sa);
sa.sun_family = AF_UNIX;
size = strlcpy(sa.sun_path, socket_path, sizeof sa.sun_path);
@ -423,7 +423,7 @@ server_child_signal(void)
}
}
}
/* Fill window pollfds. */
void
server_fill_windows(struct pollfd **pfd)
@ -554,7 +554,7 @@ server_redraw_locked(struct client *c)
&global_window_options, "clock-mode-colour");
style = options_get_number(
&global_window_options, "clock-mode-style");
screen_init(&screen, xx, yy, 0);
screen_write_start(&ctx, NULL, &screen);
@ -641,7 +641,7 @@ server_fill_clients(struct pollfd **pfd)
}
(*pfd)++;
}
/*
* Clear any window redraw flags (will have been redrawn as part of
* client).
@ -650,7 +650,7 @@ server_fill_clients(struct pollfd **pfd)
w = ARRAY_ITEM(&windows, i);
if (w == NULL)
continue;
w->flags &= ~WINDOW_REDRAW;
TAILQ_FOREACH(wp, &w->panes, entry)
wp->flags &= ~PANE_REDRAW;
@ -745,7 +745,7 @@ server_handle_client(struct client *c)
}
if (server_locked)
continue;
/* Check for mouse keys. */
if (key == KEYC_MOUSE) {
window_pane_mouse(wp, c, mouse[0], mouse[1], mouse[2]);
@ -784,7 +784,7 @@ server_handle_client(struct client *c)
window_pane_key(wp, c, key);
continue;
}
/* If this key can repeat, reset the repeat flags and timer. */
if (xtimeout != 0 && bd->can_repeat) {
c->flags |= CLIENT_PREFIX|CLIENT_REPEAT;
@ -803,7 +803,7 @@ server_handle_client(struct client *c)
return;
wp = c->session->curw->window->active; /* could die - do each loop */
s = wp->screen;
/* Ensure cursor position and mode settings. */
status = options_get_number(&c->session->options, "status");
if (wp->yoff + s->cy < c->tty.sy - status)
@ -942,7 +942,7 @@ server_check_window(struct window *w)
layout_refresh(w, 0);
}
wp = wq;
}
}
if (!destroyed)
return;
@ -1022,7 +1022,7 @@ server_second_timers(void)
if (ARRAY_ITEM(&clients, i) != NULL)
server_redraw_client(ARRAY_ITEM(&clients, i));
}
}
}
}
/* Update socket execute permissions based on whether sessions are attached. */

View File

@ -1,4 +1,4 @@
/* $Id: session.c,v 1.55 2009-03-21 12:44:06 nicm Exp $ */
/* $Id: session.c,v 1.56 2009-05-04 17:58:27 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@ -212,7 +212,7 @@ session_new(struct session *s,
if (options_get_number(&s->options, "set-remain-on-exit"))
options_set_number(&w->options, "remain-on-exit", 1);
return (session_attach(s, w, idx, cause));
}

10
tmux.1
View File

@ -1,4 +1,4 @@
.\" $Id: tmux.1,v 1.94 2009-04-30 06:01:24 nicm Exp $
.\" $Id: tmux.1,v 1.95 2009-05-04 17:58:27 nicm Exp $
.\"
.\" Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
.\"
@ -94,7 +94,7 @@ a full path is not necessary: the sockets are all created in the same
directory.
.It Fl S Ar socket-path
Specify a full alternative path to the server socket.
If
If
.Fl S
is specified, the default socket directory is not used and any
.Fl L
@ -391,7 +391,7 @@ When the argument does not contain a colon (:),
first attempts to parse it as window index; if that fails, an attempt is made
to match a session or client name.
.Pp
Multiple commands may be specified together as part of a
Multiple commands may be specified together as part of a
.Em command sequence .
Each command should be separated by spaces and a semicolon
.Eo ( Ql \& \&; \& Ec ) ;
@ -967,7 +967,7 @@ Whether a key repeats may be set when it is bound using the
.Fl r
flag to
.Ic bind-key .
Repeat is enabled for the default keys of the
Repeat is enabled for the default keys of the
.Ic up-pane ,
.Ic down-pane ,
.Ic resize-pane-up ,
@ -1023,7 +1023,7 @@ to the left of the status bar.
will be passed through
.Xr strftime 3
before being used.
By default, the session name is shown.
By default, the session name is shown.
.Ar string
may contain any of the following special character pairs:
.Bl -column "Character pair" "Replaced with" -offset indent

6
tmux.c
View File

@ -1,4 +1,4 @@
/* $Id: tmux.c,v 1.113 2009-04-20 19:25:58 nicm Exp $ */
/* $Id: tmux.c,v 1.114 2009-05-04 17:58:27 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@ -363,7 +363,7 @@ main(int argc, char **argv)
}
options_set_string(
&global_options, "default-command", "exec %s", shell);
if (getcwd(cwd, sizeof cwd) == NULL) {
log_warn("getcwd");
@ -404,7 +404,7 @@ main(int argc, char **argv)
}
}
}
memset(&cctx, 0, sizeof cctx);
if (client_init(path, &cctx, start_server, flags) != 0)
exit(1);

16
tmux.h
View File

@ -1,4 +1,4 @@
/* $Id: tmux.h,v 1.311 2009-05-04 13:20:02 nicm Exp $ */
/* $Id: tmux.h,v 1.312 2009-05-04 17:58:27 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@ -351,7 +351,7 @@ struct tty_term_code_entry {
/* Output commands. */
enum tty_cmd {
TTY_CELL,
TTY_CELL,
TTY_CLEARENDOFLINE,
TTY_CLEARENDOFSCREEN,
TTY_CLEARLINE,
@ -445,7 +445,7 @@ enum mode_key_cmd {
MODEKEYCMD_UP,
};
struct mode_key_data {
struct mode_key_data {
int type;
int flags;
@ -608,7 +608,7 @@ struct input_ctx {
size_t off;
struct grid_cell cell;
struct grid_cell saved_cell;
u_int saved_cx;
@ -663,7 +663,7 @@ struct window_pane {
#define PANE_HIDDEN 0x1
#define PANE_RESTART 0x2
#define PANE_REDRAW 0x4
char *cmd;
char *cwd;
@ -690,13 +690,13 @@ struct window {
char *name;
struct timeval name_timer;
struct window_pane *active;
struct window_pane *active;
struct window_panes panes;
u_int layout;
u_int sx;
u_int sy;
int flags;
#define WINDOW_BELL 0x1
#define WINDOW_HIDDEN 0x2
@ -1593,7 +1593,7 @@ struct session *session_create(const char *, const char *,
const char *, u_int, u_int, char **);
void session_destroy(struct session *);
int session_index(struct session *, u_int *);
struct winlink *session_new(struct session *,
struct winlink *session_new(struct session *,
const char *, const char *, const char *, int, char **);
struct winlink *session_attach(
struct session *, struct window *, int, char **);

View File

@ -1,4 +1,4 @@
/* $Id: tty-keys.c,v 1.25 2009-04-17 12:36:21 nicm Exp $ */
/* $Id: tty-keys.c,v 1.26 2009-05-04 17:58:27 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@ -135,7 +135,7 @@ tty_keys_add(struct tty *tty, const char *s, int key, int flags)
tl.string = s;
if ((tk = RB_FIND(tty_keys, &tty->ktree, &tl)) != NULL) {
log_debug("already key matching: %s (old %x, new %x)",
log_debug("already key matching: %s (old %x, new %x)",
tk->string, tk->key, key);
return;
}
@ -190,7 +190,7 @@ void
tty_keys_free(struct tty *tty)
{
struct tty_key *tk;
while (!RB_EMPTY(&tty->ktree)) {
tk = RB_ROOT(&tty->ktree);
RB_REMOVE(tty_keys, &tty->ktree, tk);
@ -271,7 +271,7 @@ tty_keys_next(struct tty *tty, int *key, u_char *mouse)
buffer_remove(tty->in, size);
goto found;
}
/* Escape but no key string. If the timer isn't started, start it. */
if (!(tty->flags & TTY_ESCAPE)) {
tv.tv_sec = 0;
@ -293,7 +293,7 @@ tty_keys_next(struct tty *tty, int *key, u_char *mouse)
buffer_remove(tty->in, 1);
*key = KEYC_ADDESC(buffer_read8(tty->in));
goto found;
}
}
/* Or a key string? */
if (len > 1) {
@ -310,7 +310,7 @@ tty_keys_next(struct tty *tty, int *key, u_char *mouse)
fatal("gettimeofday");
if (timercmp(&tty->key_timer, &tv, >))
return (1);
/* Give up and return the escape. */
buffer_remove(tty->in, 1);
*key = '\033';
@ -333,7 +333,7 @@ tty_keys_parse_mouse(
if (len != 6 || memcmp(buf, "\033[M", 3) != 0)
return (KEYC_NONE);
*size = 6;
if (buf[3] < 32 || buf[4] < 33 || buf[5] < 33)
return (KEYC_NONE);

View File

@ -1,4 +1,4 @@
/* $Id: tty-term.c,v 1.18 2009-04-23 21:09:17 nicm Exp $ */
/* $Id: tty-term.c,v 1.19 2009-05-04 17:58:27 nicm Exp $ */
/*
* Copyright (c) 2008 Nicholas Marriott <nicm@users.sourceforge.net>
@ -267,10 +267,10 @@ tty_term_find(char *name, int fd, char **cause)
xasprintf(cause, "terminal does not support dl1 or dl");
goto error;
}
if (!tty_term_has(term, TTYC_ICH1) &&
if (!tty_term_has(term, TTYC_ICH1) &&
!tty_term_has(term, TTYC_ICH) && (!tty_term_has(term, TTYC_SMIR) ||
!tty_term_has(term, TTYC_RMIR))) {
xasprintf(cause,
xasprintf(cause,
"terminal does not support ich1 or ich or smir and rmir");
goto error;
}

View File

@ -1,4 +1,4 @@
/* $Id: tty-write.c,v 1.14 2009-04-02 21:15:56 nicm Exp $ */
/* $Id: tty-write.c,v 1.15 2009-05-04 17:58:27 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@ -56,7 +56,7 @@ tty_vwrite_cmd(struct window_pane *wp, enum tty_cmd cmd, va_list ap)
if (c->session->curw->window == wp->window) {
tty_update_mode(&c->tty, c->tty.mode & ~MODE_CURSOR);
va_copy(aq, ap);
tty_vwrite(&c->tty, wp, cmd, aq);
va_end(aq);

24
tty.c
View File

@ -1,4 +1,4 @@
/* $Id: tty.c,v 1.96 2009-05-04 17:52:14 nicm Exp $ */
/* $Id: tty.c,v 1.97 2009-05-04 17:58:27 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@ -163,7 +163,7 @@ tty_start_tty(struct tty *tty)
tty_putcode(tty, TTYC_SMKX);
tty_putcode(tty, TTYC_ENACS);
tty_putcode(tty, TTYC_CLEAR);
tty_putcode(tty, TTYC_CNORM);
if (tty_term_has(tty->term, TTYC_KMOUS))
tty_puts(tty, "\033[?1000l");
@ -200,7 +200,7 @@ tty_stop_tty(struct tty *tty)
tty_raw(tty, tty_term_string(tty->term, TTYC_CLEAR));
tty_raw(tty, tty_term_string(tty->term, TTYC_RMKX));
tty_raw(tty, tty_term_string(tty->term, TTYC_RMCUP));
tty_raw(tty, tty_term_string(tty->term, TTYC_CNORM));
if (tty_term_has(tty->term, TTYC_KMOUS))
tty_raw(tty, "\033[?1000l");
@ -243,7 +243,7 @@ tty_close(struct tty *tty, int no_stop)
if (!no_stop)
tty_stop_tty(tty);
tty_term_free(tty->term);
tty_keys_free(tty);
@ -440,7 +440,7 @@ tty_draw_line(struct tty *tty, struct screen *s, u_int py, u_int ox, u_int oy)
if (sx >= tty->sx)
return;
tty_reset(tty);
tty_cursor(tty, sx, py, ox, oy);
if (screen_size_x(s) >= tty->sx && tty_term_has(tty->term, TTYC_EL))
tty_putcode(tty, TTYC_EL);
@ -486,7 +486,7 @@ tty_cmd_insertcharacter(struct tty *tty, struct window_pane *wp, va_list ap)
tty_reset(tty);
tty_cursor(tty, s->old_cx, s->old_cy, wp->xoff, wp->yoff);
if (tty_term_has(tty->term, TTYC_ICH) ||
if (tty_term_has(tty->term, TTYC_ICH) ||
tty_term_has(tty->term, TTYC_ICH1))
tty_emulate_repeat(tty, TTYC_ICH, TTYC_ICH1, ua);
else {
@ -788,7 +788,7 @@ tty_cell(
u_int i;
/* Skip last character if terminal is stupid. */
if (tty->term->flags & TERM_EARLYWRAP &&
if (tty->term->flags & TERM_EARLYWRAP &&
tty->cy == tty->sy - 1 && tty->cx == tty->sx - 1)
return;
@ -895,7 +895,7 @@ tty_attributes(struct tty *tty, const struct grid_cell *gc)
if (tty_term_has(tty->term, TTYC_REV))
tty_putcode(tty, TTYC_REV);
else if (tty_term_has(tty->term, TTYC_SMSO))
tty_putcode(tty, TTYC_SMSO);
tty_putcode(tty, TTYC_SMSO);
}
if (changed & GRID_ATTR_HIDDEN)
tty_putcode(tty, TTYC_INVIS);
@ -922,10 +922,10 @@ tty_try_256(struct tty *tty, u_char colour, const char *type)
{
char s[32];
if (!(tty->term->flags & TERM_256COLOURS) &&
if (!(tty->term->flags & TERM_256COLOURS) &&
!(tty->term_flags & TERM_256COLOURS))
return (-1);
xsnprintf(s, sizeof s, "\033[%s;5;%hhum", type, colour);
tty_puts(tty, s);
return (0);
@ -935,7 +935,7 @@ int
tty_try_88(struct tty *tty, u_char colour, const char *type)
{
char s[32];
if (!(tty->term->flags & TERM_88COLOURS) &&
!(tty->term_flags & TERM_88COLOURS))
return (-1);
@ -965,7 +965,7 @@ tty_attributes_fg(struct tty *tty, const struct grid_cell *gc)
} else if (tty->cell.attr & GRID_ATTR_BRIGHT)
tty_reset(tty);
}
if (fg == 8 &&
!(tty->term->flags & TERM_HASDEFAULTS) &&
!(tty->term_flags & TERM_HASDEFAULTS))

4
utf8.c
View File

@ -1,4 +1,4 @@
/* $Id: utf8.c,v 1.5 2009-04-30 20:54:53 nicm Exp $ */
/* $Id: utf8.c,v 1.6 2009-05-04 17:58:27 nicm Exp $ */
/*
* Copyright (c) 2008 Nicholas Marriott <nicm@users.sourceforge.net>
@ -231,7 +231,7 @@ utf8_build(void)
ptr = &utf8_width_root;
while (*ptr != NULL) {
node = *ptr;
node = *ptr;
if (item->last < node->first)
ptr = &(node->left);
else if (item->first > node->last)

View File

@ -1,4 +1,4 @@
/* $Id: window-choose.c,v 1.13 2009-03-02 17:01:00 nicm Exp $ */
/* $Id: window-choose.c,v 1.14 2009-05-04 17:58:27 nicm Exp $ */
/*
* Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net>
@ -121,7 +121,7 @@ window_choose_init(struct window_pane *wp)
mode_key_init(&data->mdata,
options_get_number(&wp->window->options, "mode-keys"),
MODEKEY_CHOOSEMODE);
return (s);
}
@ -132,7 +132,7 @@ window_choose_free(struct window_pane *wp)
u_int i;
mode_key_free(&data->mdata);
for (i = 0; i < ARRAY_LENGTH(&data->list); i++)
xfree(ARRAY_ITEM(&data->list, i).name);
ARRAY_FREE(&data->list);
@ -196,7 +196,7 @@ window_choose_key(struct window_pane *wp, unused struct client *c, int key)
window_choose_write_line(
wp, &ctx, data->selected + 1 - data->top);
screen_write_stop(&ctx);
}
}
break;
case MODEKEYCMD_DOWN:
if (items == 0)
@ -217,7 +217,7 @@ window_choose_key(struct window_pane *wp, unused struct client *c, int key)
window_choose_write_line(
wp, &ctx, data->selected - 1 - data->top);
screen_write_stop(&ctx);
}
}
break;
case MODEKEYCMD_PREVIOUSPAGE:
if (data->selected < screen_size_y(s)) {
@ -354,7 +354,7 @@ window_choose_scroll_down(struct window_pane *wp)
screen_write_start(&ctx, wp, NULL);
screen_write_cursormove(&ctx, 0, 0);
screen_write_deleteline(&ctx, 1);
window_choose_write_line(wp, &ctx, screen_size_y(s) - 1);
window_choose_write_line(wp, &ctx, screen_size_y(s) - 1);
if (screen_size_y(&data->screen) > 1)
window_choose_write_line(wp, &ctx, screen_size_y(s) - 2);
screen_write_stop(&ctx);

View File

@ -1,4 +1,4 @@
/* $Id: window-copy.c,v 1.59 2009-03-31 15:10:43 nicm Exp $ */
/* $Id: window-copy.c,v 1.60 2009-05-04 17:58:27 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@ -134,7 +134,7 @@ window_copy_pageup(struct window_pane *wp)
{
struct window_copy_mode_data *data = wp->modedata;
struct screen *s = &data->screen;
if (data->oy + screen_size_y(s) > screen_hsize(&wp->base))
data->oy = screen_hsize(&wp->base);
else
@ -142,7 +142,7 @@ window_copy_pageup(struct window_pane *wp)
window_copy_update_selection(wp);
window_copy_redraw_screen(wp);
}
void
window_copy_resize(struct window_pane *wp, u_int sx, u_int sy)
{
@ -236,9 +236,9 @@ window_copy_mouse(struct window_pane *wp,
data->cx = x;
data->cy = y;
if (window_copy_update_selection(wp))
window_copy_redraw_screen(wp);
window_copy_redraw_screen(wp);
window_copy_update_cursor(wp);
}

View File

@ -1,4 +1,4 @@
/* $Id: window-scroll.c,v 1.32 2009-02-13 21:39:45 nicm Exp $ */
/* $Id: window-scroll.c,v 1.33 2009-05-04 17:58:27 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@ -99,12 +99,12 @@ window_scroll_pageup(struct window_pane *wp)
{
struct window_scroll_mode_data *data = wp->modedata;
struct screen *s = &data->screen;
if (data->oy + screen_size_y(s) > screen_hsize(&wp->base))
data->oy = screen_hsize(&wp->base);
else
data->oy += screen_size_y(s);
window_scroll_redraw_screen(wp);
}

View File

@ -1,4 +1,4 @@
/* $Id: window.c,v 1.72 2009-04-01 18:46:03 nicm Exp $ */
/* $Id: window.c,v 1.73 2009-05-04 17:58:27 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@ -289,7 +289,7 @@ window_fit_panes(struct window *w)
struct window_pane *wp;
u_int npanes, canfit, total;
int left;
if (TAILQ_EMPTY(&w->panes))
return;
@ -352,7 +352,7 @@ window_fit_panes(struct window *w)
}
}
}
/* Now do the resize. */
TAILQ_FOREACH(wp, &w->panes, entry) {
wp->sy--;