Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Import upstream snapshot from SVN r2642

  • Loading branch information...
commit d87347493621c666465f858b0377fdef0adea10b 1 parent c2acb99
@orebokech orebokech authored
View
2  TODO
@@ -140,6 +140,8 @@
- fetch full command line on !Linux, and add option to strip prefixes
such as "sh " "/bin/sh " etc etc
- synchronize-windows option
+- possibly support rxvt-unicode extended mouse input (1015)
+- append to buffer in copy mode
* We need a tmux terminfo entry to document the extensions we are using in
upstream terminfo. Must NOT change (only add or remove) anything from
TERM=screen so we can fallback!
View
8 cmd-list-panes.c
@@ -1,4 +1,4 @@
-/* $Id: cmd-list-panes.c 2591 2011-09-21 16:31:15Z tcunha $ */
+/* $Id: cmd-list-panes.c 2639 2011-11-25 13:31:56Z tcunha $ */
/*
* Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -102,21 +102,21 @@ cmd_list_panes_window(struct cmd *self,
if (template == NULL) {
switch (type) {
case 0:
- template = "#{line}: "
+ template = "#{pane_index}: "
"[#{pane_width}x#{pane_height}] [history "
"#{history_size}/#{history_limit}, "
"#{history_bytes} bytes] #{pane_id}"
"#{?pane_active, (active),}#{?pane_dead, (dead),}";
break;
case 1:
- template = "#{window_index}.#{line}: "
+ template = "#{window_index}.#{pane_index}: "
"[#{pane_width}x#{pane_height}] [history "
"#{history_size}/#{history_limit}, "
"#{history_bytes} bytes] #{pane_id}"
"#{?pane_active, (active),}#{?pane_dead, (dead),}";
break;
case 2:
- template = "#{session_name}:#{window_index}.#{line}: "
+ template = "#{session_name}:#{window_index}.#{pane_index}: "
"[#{pane_width}x#{pane_height}] [history "
"#{history_size}/#{history_limit}, "
"#{history_bytes} bytes] #{pane_id}"
View
9 cmd-respawn-pane.c
@@ -1,4 +1,4 @@
-/* $Id: cmd-respawn-pane.c 2553 2011-07-09 09:42:33Z tcunha $ */
+/* $Id: cmd-respawn-pane.c 2638 2011-11-25 13:30:45Z tcunha $ */
/*
* Copyright (c) 2008 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -49,15 +49,18 @@ cmd_respawn_pane_exec(struct cmd *self, struct cmd_ctx *ctx)
struct session *s;
struct environ env;
const char *cmd;
- char *cause;
+ char *cause;
+ u_int idx;
if ((wl = cmd_find_pane(ctx, args_get(args, 't'), &s, &wp)) == NULL)
return (-1);
w = wl->window;
if (!args_has(self->args, 'k') && wp->fd != -1) {
+ if (window_pane_index(wp, &idx) != 0)
+ fatalx("index not found");
ctx->error(ctx, "pane still active: %s:%u.%u",
- s->name, wl->idx, window_pane_index(w, wp));
+ s->name, wl->idx, idx);
return (-1);
}
View
5 cmd-split-window.c
@@ -1,4 +1,4 @@
-/* $Id: cmd-split-window.c 2594 2011-09-21 16:34:04Z tcunha $ */
+/* $Id: cmd-split-window.c 2638 2011-11-25 13:30:45Z tcunha $ */
/*
* Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -139,7 +139,8 @@ cmd_split_window_exec(struct cmd *self, struct cmd_ctx *ctx)
environ_free(&env);
if (args_has(args, 'P')) {
- paneidx = window_pane_index(wl->window, new_wp);
+ if (window_pane_index(new_wp, &paneidx) != 0)
+ fatalx("index not found");
ctx->print(ctx, "%s:%u.%u", s->name, wl->idx, paneidx);
}
return (0);
View
19 examples/tmux.vim
@@ -47,11 +47,11 @@ syn keyword tmuxCmds capture-pane joinp join-pane choose-buffer
syn keyword tmuxOptsSet prefix status status-fg status-bg bell-action
syn keyword tmuxOptsSet default-command history-limit status-left status-right
syn keyword tmuxOptsSet status-interval set-titles display-time buffer-limit
-syn keyword tmuxOptsSet status-left-length status-right-length message-fg
-syn keyword tmuxOptsSet message-bg lock-after-time default-path repeat-time
-syn keyword tmuxOptsSet message-attr status-attr status-keys set-remain-on-exit
-syn keyword tmuxOptsSet status-utf8 default-terminal visual-activity
-syn keyword tmuxOptsSet visual-bell visual-content status-justify
+syn keyword tmuxOptsSet status-left-length status-right-length
+syn keyword tmuxOptsSet message-[command-]bg lock-after-time default-path
+syn keyword tmuxOptsSet message-[command-]attr status-attr set-remain-on-exit
+syn keyword tmuxOptsSet status-utf8 default-terminal visual-activity repeat-time
+syn keyword tmuxOptsSet visual-bell visual-content status-justify status-keys
syn keyword tmuxOptsSet terminal-overrides status-left-attr status-left-bg
syn keyword tmuxOptsSet status-left-fg status-right-attr status-right-bg
syn keyword tmuxOptsSet status-right-fg update-environment base-index
@@ -59,9 +59,11 @@ syn keyword tmuxOptsSet display-panes-colour display-panes-time default-shell
syn keyword tmuxOptsSet set-titles-string lock-command lock-server
syn keyword tmuxOptsSet mouse-select-pane message-limit quiet escape-time
syn keyword tmuxOptsSet pane-active-border-bg pane-active-border-fg
-syn keyword tmuxOptsSet pane-border-bg pane-border-fg
+syn keyword tmuxOptsSet pane-border-bg pane-border-fg message-[command-]fg
syn keyword tmuxOptsSet display-panes-active-colour alternate-screen
-syn keyword tmuxOptsSet detach-on-destroy
+syn keyword tmuxOptsSet detach-on-destroy word-separators
+syn keyword tmuxOptsSet destroy-unattached exit-unattached set-clipboard
+syn keyword tmuxOptsSet bell-on-alert mouse-select-window mouse-utf8
syn keyword tmuxOptsSetw monitor-activity aggressive-resize force-width
syn keyword tmuxOptsSetw force-height remain-on-exit uft8 mode-fg mode-bg
@@ -72,8 +74,9 @@ syn keyword tmuxOptsSetw main-pane-width main-pane-height monitor-content
syn keyword tmuxOptsSetw window-status-current-attr window-status-current-bg
syn keyword tmuxOptsSetw window-status-current-fg mode-mouse synchronize-panes
syn keyword tmuxOptsSetw window-status-format window-status-current-format
-syn keyword tmuxOptsSetw word-separators window-status-alert-alert
+syn keyword tmuxOptsSetw window-status-alert-attr
syn keyword tmuxOptsSetw window-status-alert-bg window-status-alert-fg
+syn keyword tmuxOptsSetw pane-base-index other-pane-height other-pane-width
syn keyword tmuxTodo FIXME NOTE TODO XXX contained
View
5 format.c
@@ -361,6 +361,7 @@ format_window_pane(struct format_tree *ft, struct window_pane *wp)
struct grid_line *gl;
unsigned long long size;
u_int i;
+ u_int idx;
size = 0;
for (i = 0; i < gd->hsize; i++) {
@@ -370,9 +371,13 @@ format_window_pane(struct format_tree *ft, struct window_pane *wp)
}
size += gd->hsize * sizeof *gd->linedata;
+ if (window_pane_index(wp, &idx) != 0)
+ fatalx("index not found");
+
format_add(ft, "pane_width", "%u", wp->sx);
format_add(ft, "pane_height", "%u", wp->sy);
format_add(ft, "pane_title", "%s", wp->base.title);
+ format_add(ft, "pane_index", "%u", idx);
format_add(ft, "history_size", "%u", gd->hsize);
format_add(ft, "history_limit", "%u", gd->hlimit);
format_add(ft, "history_bytes", "%llu", size);
View
6 layout-set.c
@@ -1,4 +1,4 @@
-/* $Id: layout-set.c 2553 2011-07-09 09:42:33Z tcunha $ */
+/* $Id: layout-set.c 2634 2011-11-10 21:41:37Z tcunha $ */
/*
* Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -260,8 +260,8 @@ layout_set_main_h(struct window *w)
* If an other pane height was specified, honour it so long as it
* doesn't shrink the main height to less than the main-pane-height
*/
- if (otherheight > 1 && w->sx - otherheight > mainheight)
- mainheight = w->sx - otherheight;
+ if (otherheight > 1 && w->sy - otherheight > mainheight)
+ mainheight = w->sy - otherheight;
if (mainheight < PANE_MINIMUM + 1)
mainheight = PANE_MINIMUM + 1;
View
25 mode-key.c
@@ -1,4 +1,4 @@
-/* $Id: mode-key.c 2581 2011-08-21 12:37:26Z tcunha $ */
+/* $Id: mode-key.c 2641 2011-11-25 13:34:20Z tcunha $ */
/*
* Copyright (c) 2008 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -49,11 +49,15 @@ const struct mode_key_cmdstr mode_key_cmdstr_edit[] = {
{ MODEKEYEDIT_DELETE, "delete" },
{ MODEKEYEDIT_DELETELINE, "delete-line" },
{ MODEKEYEDIT_DELETETOENDOFLINE, "delete-end-of-line" },
+ { MODEKEYEDIT_DELETEWORD, "delete-word" },
{ MODEKEYEDIT_ENDOFLINE, "end-of-line" },
{ MODEKEYEDIT_ENTER, "enter" },
{ MODEKEYEDIT_HISTORYDOWN, "history-down" },
{ MODEKEYEDIT_HISTORYUP, "history-up" },
+ { MODEKEYEDIT_NEXTWORD, "next-word" },
+ { MODEKEYEDIT_NEXTWORDEND, "next-word-end" },
{ MODEKEYEDIT_PASTE, "paste" },
+ { MODEKEYEDIT_PREVIOUSWORD, "previous-word" },
{ MODEKEYEDIT_STARTOFLINE, "start-of-line" },
{ MODEKEYEDIT_SWITCHMODE, "switch-mode" },
{ MODEKEYEDIT_SWITCHMODEAPPEND, "switch-mode-append" },
@@ -127,7 +131,8 @@ const struct mode_key_entry mode_key_vi_edit[] = {
{ '\003' /* C-c */, 0, MODEKEYEDIT_CANCEL },
{ '\010' /* C-h */, 0, MODEKEYEDIT_BACKSPACE },
{ '\011' /* Tab */, 0, MODEKEYEDIT_COMPLETE },
- { '\025' /* C-u */, 0, MODEKEYEDIT_DELETELINE },
+ { '\025' /* C-u */, 0, MODEKEYEDIT_DELETELINE },
+ { '\027' /* C-w */, 0, MODEKEYEDIT_DELETEWORD },
{ '\033' /* Escape */, 0, MODEKEYEDIT_SWITCHMODE },
{ '\r', 0, MODEKEYEDIT_ENTER },
{ KEYC_BSPACE, 0, MODEKEYEDIT_BACKSPACE },
@@ -145,13 +150,16 @@ const struct mode_key_entry mode_key_vi_edit[] = {
{ '\r', 1, MODEKEYEDIT_ENTER },
{ '^', 1, MODEKEYEDIT_STARTOFLINE },
{ 'a', 1, MODEKEYEDIT_SWITCHMODEAPPEND },
+ { 'b', 1, MODEKEYEDIT_PREVIOUSWORD },
{ 'd', 1, MODEKEYEDIT_DELETELINE },
+ { 'e', 1, MODEKEYEDIT_NEXTWORDEND },
{ 'h', 1, MODEKEYEDIT_CURSORLEFT },
{ 'i', 1, MODEKEYEDIT_SWITCHMODE },
{ 'j', 1, MODEKEYEDIT_HISTORYDOWN },
{ 'k', 1, MODEKEYEDIT_HISTORYUP },
{ 'l', 1, MODEKEYEDIT_CURSORRIGHT },
{ 'p', 1, MODEKEYEDIT_PASTE },
+ { 'w', 1, MODEKEYEDIT_NEXTWORD },
{ KEYC_BSPACE, 1, MODEKEYEDIT_BACKSPACE },
{ KEYC_DC, 1, MODEKEYEDIT_DELETE },
{ KEYC_DOWN, 1, MODEKEYEDIT_HISTORYDOWN },
@@ -259,18 +267,21 @@ const struct mode_key_entry mode_key_emacs_edit[] = {
{ '\002' /* C-b */, 0, MODEKEYEDIT_CURSORLEFT },
{ '\003' /* C-c */, 0, MODEKEYEDIT_CANCEL },
{ '\004' /* C-d */, 0, MODEKEYEDIT_DELETE },
- { '\005' /* C-e */, 0, MODEKEYEDIT_ENDOFLINE },
+ { '\005' /* C-e */, 0, MODEKEYEDIT_ENDOFLINE },
{ '\006' /* C-f */, 0, MODEKEYEDIT_CURSORRIGHT },
- { '\010' /* C-H */, 0, MODEKEYEDIT_BACKSPACE },
- { '\011' /* Tab */, 0, MODEKEYEDIT_COMPLETE },
- { '\013' /* C-k */, 0, MODEKEYEDIT_DELETETOENDOFLINE },
+ { '\010' /* C-H */, 0, MODEKEYEDIT_BACKSPACE },
+ { '\011' /* Tab */, 0, MODEKEYEDIT_COMPLETE },
+ { '\013' /* C-k */, 0, MODEKEYEDIT_DELETETOENDOFLINE },
{ '\016' /* C-n */, 0, MODEKEYEDIT_HISTORYDOWN },
{ '\020' /* C-p */, 0, MODEKEYEDIT_HISTORYUP },
{ '\024' /* C-t */, 0, MODEKEYEDIT_TRANSPOSECHARS },
- { '\025' /* C-u */, 0, MODEKEYEDIT_DELETELINE },
+ { '\025' /* C-u */, 0, MODEKEYEDIT_DELETELINE },
+ { '\027' /* C-w */, 0, MODEKEYEDIT_DELETEWORD },
{ '\031' /* C-y */, 0, MODEKEYEDIT_PASTE },
{ '\033' /* Escape */, 0, MODEKEYEDIT_CANCEL },
{ '\r', 0, MODEKEYEDIT_ENTER },
+ { 'b' | KEYC_ESCAPE, 0, MODEKEYEDIT_PREVIOUSWORD },
+ { 'f' | KEYC_ESCAPE, 0, MODEKEYEDIT_NEXTWORDEND },
{ 'm' | KEYC_ESCAPE, 0, MODEKEYEDIT_STARTOFLINE },
{ KEYC_BSPACE, 0, MODEKEYEDIT_BACKSPACE },
{ KEYC_DC, 0, MODEKEYEDIT_DELETE },
View
27 options-table.c
@@ -1,4 +1,4 @@
-/* $Id: options-table.c 2629 2011-10-31 13:56:16Z tcunha $ */
+/* $Id: options-table.c 2640 2011-11-25 13:33:04Z tcunha $ */
/*
* Copyright (c) 2011 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -193,6 +193,21 @@ const struct options_table_entry session_options_table[] = {
.default_num = 3
},
+ { .name = "message-command-attr",
+ .type = OPTIONS_TABLE_ATTRIBUTES,
+ .default_num = 0
+ },
+
+ { .name = "message-command-bg",
+ .type = OPTIONS_TABLE_COLOUR,
+ .default_num = 0
+ },
+
+ { .name = "message-command-fg",
+ .type = OPTIONS_TABLE_COLOUR,
+ .default_num = 3
+ },
+
{ .name = "message-fg",
.type = OPTIONS_TABLE_COLOUR,
.default_num = 0
@@ -405,6 +420,11 @@ const struct options_table_entry session_options_table[] = {
.default_num = 0
},
+ { .name = "word-separators",
+ .type = OPTIONS_TABLE_STRING,
+ .default_str = " -_@"
+ },
+
{ .name = NULL }
};
@@ -599,11 +619,6 @@ const struct options_table_entry window_options_table[] = {
.default_str = "#I:#W#F"
},
- { .name = "word-separators",
- .type = OPTIONS_TABLE_STRING,
- .default_str = " -_@"
- },
-
{ .name = "xterm-keys",
.type = OPTIONS_TABLE_FLAG,
.default_num = 0
View
7 screen-redraw.c
@@ -1,4 +1,4 @@
-/* $Id: screen-redraw.c 2553 2011-07-09 09:42:33Z tcunha $ */
+/* $Id: screen-redraw.c 2638 2011-11-25 13:30:45Z tcunha $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -264,7 +264,7 @@ screen_redraw_draw_number(struct client *c, struct window_pane *wp)
{
struct tty *tty = &c->tty;
struct session *s = c->session;
- struct options *oo = &s->options;
+ struct options *oo = &s->options;
struct window *w = wp->window;
struct grid_cell gc;
u_int idx, px, py, i, j, xoff, yoff;
@@ -272,7 +272,8 @@ screen_redraw_draw_number(struct client *c, struct window_pane *wp)
char buf[16], *ptr;
size_t len;
- idx = window_pane_index(w, wp);
+ if (window_pane_index(wp, &idx) != 0)
+ fatalx("index not found");
len = xsnprintf(buf, sizeof buf, "%u", idx);
if (wp->sx < len)
View
126 status.c
@@ -1,4 +1,4 @@
-/* $Id: status.c 2583 2011-08-21 12:39:34Z tcunha $ */
+/* $Id: status.c 2641 2011-11-25 13:34:20Z tcunha $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -372,6 +372,7 @@ status_replace1(struct client *c, struct session *s, struct winlink *wl,
char ch, tmp[256], *ptr, *endptr, *freeptr;
size_t ptrlen;
long limit;
+ u_int idx;
if (s == NULL)
s = c->session;
@@ -422,8 +423,10 @@ status_replace1(struct client *c, struct session *s, struct winlink *wl,
ptr = tmp;
goto do_replace;
case 'P':
+ if (window_pane_index(wp, &idx) != 0)
+ fatalx("index not found");
xsnprintf(
- tmp, sizeof tmp, "%u", window_pane_index(wl->window, wp));
+ tmp, sizeof tmp, "%u", idx);
ptr = tmp;
goto do_replace;
case 'S':
@@ -919,9 +922,16 @@ status_prompt_redraw(struct client *c)
off = 0;
memcpy(&gc, &grid_default_cell, sizeof gc);
- colour_set_fg(&gc, options_get_number(&s->options, "message-fg"));
- colour_set_bg(&gc, options_get_number(&s->options, "message-bg"));
- gc.attr |= options_get_number(&s->options, "message-attr");
+ /* Change colours for command mode. */
+ if (c->prompt_mdata.mode == 1) {
+ colour_set_fg(&gc, options_get_number(&s->options, "message-command-fg"));
+ colour_set_bg(&gc, options_get_number(&s->options, "message-command-bg"));
+ gc.attr |= options_get_number(&s->options, "message-command-attr");
+ } else {
+ colour_set_fg(&gc, options_get_number(&s->options, "message-fg"));
+ colour_set_bg(&gc, options_get_number(&s->options, "message-bg"));
+ gc.attr |= options_get_number(&s->options, "message-attr");
+ }
screen_write_start(&ctx, NULL, &c->status);
@@ -963,9 +973,12 @@ status_prompt_redraw(struct client *c)
void
status_prompt_key(struct client *c, int key)
{
+ struct session *sess = c->session;
+ struct options *oo = &sess->options;
struct paste_buffer *pb;
- char *s, *first, *last, word[64], swapc;
- const char *histstr;
+ char *s, *first, *last, word[64], swapc;
+ const char *histstr;
+ const char *wsep;
u_char ch;
size_t size, n, off, idx;
@@ -977,7 +990,12 @@ status_prompt_key(struct client *c, int key)
c->flags |= CLIENT_STATUS;
}
break;
+ case MODEKEYEDIT_SWITCHMODE:
+ c->flags |= CLIENT_STATUS;
+ break;
case MODEKEYEDIT_SWITCHMODEAPPEND:
+ c->flags |= CLIENT_STATUS;
+ /* FALLTHROUGH */
case MODEKEYEDIT_CURSORRIGHT:
if (c->prompt_index < size) {
c->prompt_index++;
@@ -1077,11 +1095,103 @@ status_prompt_key(struct client *c, int key)
c->flags |= CLIENT_STATUS;
}
break;
+ case MODEKEYEDIT_DELETEWORD:
+ wsep = options_get_string(oo, "word-separators");
+ idx = c->prompt_index;
+
+ /* Find a non-separator. */
+ while (idx != 0) {
+ idx--;
+ if (!strchr(wsep, c->prompt_buffer[idx]))
+ break;
+ }
+
+ /* Find the separator at the beginning of the word. */
+ while (idx != 0) {
+ idx--;
+ if (strchr(wsep, c->prompt_buffer[idx])) {
+ /* Go back to the word. */
+ idx++;
+ break;
+ }
+ }
+
+ memmove(c->prompt_buffer + idx,
+ c->prompt_buffer + c->prompt_index,
+ size + 1 - c->prompt_index);
+ memset(c->prompt_buffer + size - (c->prompt_index - idx),
+ '\0', c->prompt_index - idx);
+ c->prompt_index = idx;
+ c->flags |= CLIENT_STATUS;
+ break;
+ case MODEKEYEDIT_NEXTWORD:
+ wsep = options_get_string(oo, "word-separators");
+
+ /* Find a separator. */
+ while (c->prompt_index != size) {
+ c->prompt_index++;
+ if (strchr(wsep, c->prompt_buffer[c->prompt_index]))
+ break;
+ }
+
+ /* Find the word right after the separation. */
+ while (c->prompt_index != size) {
+ c->prompt_index++;
+ if (!strchr(wsep, c->prompt_buffer[c->prompt_index]))
+ break;
+ }
+
+ c->flags |= CLIENT_STATUS;
+ break;
+ case MODEKEYEDIT_NEXTWORDEND:
+ wsep = options_get_string(oo, "word-separators");
+
+ /* Find a word. */
+ while (c->prompt_index != size) {
+ c->prompt_index++;
+ if (!strchr(wsep, c->prompt_buffer[c->prompt_index]))
+ break;
+ }
+
+ /* Find the separator at the end of the word. */
+ while (c->prompt_index != size) {
+ c->prompt_index++;
+ if (strchr(wsep, c->prompt_buffer[c->prompt_index])) {
+ /* Go back to the word. */
+ c->prompt_index--;
+ break;
+ }
+ }
+
+ c->flags |= CLIENT_STATUS;
+ break;
+ case MODEKEYEDIT_PREVIOUSWORD:
+ wsep = options_get_string(oo, "word-separators");
+
+ /* Find a non-separator. */
+ while (c->prompt_index != 0) {
+ c->prompt_index--;
+ if (!strchr(wsep, c->prompt_buffer[c->prompt_index]))
+ break;
+ }
+
+ /* Find the separator at the beginning of the word. */
+ while (c->prompt_index != 0) {
+ c->prompt_index--;
+ if (strchr(wsep, c->prompt_buffer[c->prompt_index])) {
+ /* Go back to the word. */
+ c->prompt_index++;
+ break;
+ }
+ }
+
+ c->flags |= CLIENT_STATUS;
+ break;
case MODEKEYEDIT_HISTORYUP:
histstr = status_prompt_up_history(&c->prompt_hindex);
if (histstr == NULL)
break;
- xfree(c->prompt_buffer);
+ xfree(c->prompt_buffer);
c->prompt_buffer = xstrdup(histstr);
c->prompt_index = strlen(c->prompt_buffer);
c->flags |= CLIENT_STATUS;
View
32 tmux.1
@@ -14,7 +14,7 @@
.\" IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
.\" OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
-.Dd $Mdocdate: October 27 2011 $
+.Dd $Mdocdate: November 15 2011 $
.Dt TMUX 1
.Os
.Sh NAME
@@ -841,7 +841,7 @@ and
characters as word delimiters by default, but this can be adjusted by
setting the
.Em word-separators
-window option.
+session option.
Next word moves to the start of the next word, next word end to the end of the
next word and previous word to the start of the previous word.
The three next and previous space keys work similarly but use a space alone as
@@ -868,6 +868,9 @@ in emacs mode, and
.Ql 10w
in vi.
.Pp
+When copying the selection, the repeat count indicates the buffer index to
+replace, if used.
+.Pp
Mode key bindings are defined in a set of named tables:
.Em vi-edit
and
@@ -1552,10 +1555,8 @@ to
.Em Home ,
.Em IC
(Insert),
-.Em NPage
-(Page Up),
-.Em PPage
-(Page Down),
+.Em NPage/PageDown/PgDn ,
+.Em PPage/PageUp/PgUp ,
.Em Space ,
and
.Em Tab .
@@ -1971,6 +1972,12 @@ from the 256-colour set,
or a hexadecimal RGB string such as
.Ql #ffffff ,
which chooses the closest match from the default 256-colour set.
+.It Ic message-command-attr Ar attributes
+Set status line message attributes when in command mode.
+.It Ic message-command-bg Ar colour
+Set status line message background colour when in command mode.
+.It Ic message-command-fg Ar colour
+Set status line message foreground colour when in command mode.
.It Ic message-fg Ar colour
Set status line message foreground colour.
.It Ic message-limit Ar number
@@ -2285,6 +2292,12 @@ window option is enabled.
If
.Ic monitor-silence
is enabled, prints a message after the interval has expired on a given window.
+.It Ic word-separators Ar string
+Sets the session's conception of what characters are considered word
+separators, for the purposes of the next and previous word commands in
+copy mode.
+The default is
+.Ql \ -_@ .
.El
.It Xo Ic set-window-option
.Op Fl agu
@@ -2525,13 +2538,6 @@ option for details of special character sequences available.
The default is
.Ql #I:#W#F .
.Pp
-.It Ic word-separators Ar string
-Sets the window's conception of what characters are considered word
-separators, for the purposes of the next and previous word commands in
-copy mode.
-The default is
-.Ql \ -_@ .
-.Pp
.It Xo Ic xterm-keys
.Op Ic on | off
.Xc
View
8 tmux.h
@@ -1,4 +1,4 @@
-/* $Id: tmux.h 2621 2011-10-23 15:10:22Z tcunha $ */
+/* $Id: tmux.h 2641 2011-11-25 13:34:20Z tcunha $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -438,11 +438,15 @@ enum mode_key_cmd {
MODEKEYEDIT_DELETE,
MODEKEYEDIT_DELETELINE,
MODEKEYEDIT_DELETETOENDOFLINE,
+ MODEKEYEDIT_DELETEWORD,
MODEKEYEDIT_ENDOFLINE,
MODEKEYEDIT_ENTER,
MODEKEYEDIT_HISTORYDOWN,
MODEKEYEDIT_HISTORYUP,
+ MODEKEYEDIT_NEXTWORD,
+ MODEKEYEDIT_NEXTWORDEND,
MODEKEYEDIT_PASTE,
+ MODEKEYEDIT_PREVIOUSWORD,
MODEKEYEDIT_STARTOFLINE,
MODEKEYEDIT_SWITCHMODE,
MODEKEYEDIT_SWITCHMODEAPPEND,
@@ -1927,7 +1931,7 @@ struct window_pane *window_pane_next_by_number(struct window *,
struct window_pane *, u_int);
struct window_pane *window_pane_previous_by_number(struct window *,
struct window_pane *, u_int);
-u_int window_pane_index(struct window *, struct window_pane *);
+int window_pane_index(struct window_pane *, u_int *);
u_int window_count_panes(struct window *);
void window_destroy_panes(struct window *);
struct window_pane *window_pane_find_by_id(u_int);
View
8 window-copy.c
@@ -1,4 +1,4 @@
-/* $Id: window-copy.c 2626 2011-10-31 13:54:28Z tcunha $ */
+/* $Id: window-copy.c 2640 2011-11-25 13:33:04Z tcunha $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -548,13 +548,13 @@ window_copy_key(struct window_pane *wp, struct session *sess, int key)
break;
case MODEKEYCOPY_NEXTWORD:
word_separators =
- options_get_string(&wp->window->options, "word-separators");
+ options_get_string(&sess->options, "word-separators");
for (; np != 0; np--)
window_copy_cursor_next_word(wp, word_separators);
break;
case MODEKEYCOPY_NEXTWORDEND:
word_separators =
- options_get_string(&wp->window->options, "word-separators");
+ options_get_string(&sess->options, "word-separators");
for (; np != 0; np--)
window_copy_cursor_next_word_end(wp, word_separators);
break;
@@ -564,7 +564,7 @@ window_copy_key(struct window_pane *wp, struct session *sess, int key)
break;
case MODEKEYCOPY_PREVIOUSWORD:
word_separators =
- options_get_string(&wp->window->options, "word-separators");
+ options_get_string(&sess->options, "word-separators");
for (; np != 0; np--)
window_copy_cursor_previous_word(wp, word_separators);
break;
View
20 window.c
@@ -1,4 +1,4 @@
-/* $Id: window.c 2606 2011-10-02 11:32:24Z tcunha $ */
+/* $Id: window.c 2638 2011-11-25 13:30:45Z tcunha $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -483,19 +483,21 @@ window_pane_previous_by_number(struct window *w, struct window_pane *wp,
return (wp);
}
-u_int
-window_pane_index(struct window *w, struct window_pane *wp)
+int
+window_pane_index(struct window_pane *wp, u_int *i)
{
struct window_pane *wq;
- u_int n;
+ struct window *w = wp->window;
- n = options_get_number(&w->options, "pane-base-index");
+ *i = options_get_number(&w->options, "pane-base-index");
TAILQ_FOREACH(wq, &w->panes, entry) {
- if (wp == wq)
- break;
- n++;
+ if (wp == wq) {
+ return (0);
+ }
+ (*i)++;
}
- return (n);
+
+ return (-1);
}
u_int
Please sign in to comment.
Something went wrong with that request. Please try again.