mirror of
https://github.com/tmux/tmux.git
synced 2026-06-20 09:25:12 +00:00
Merge branch 'obsd-master'
This commit is contained in:
44
format.c
44
format.c
@@ -1856,15 +1856,6 @@ format_cb_keypad_flag(struct format_tree *ft)
|
|||||||
return (NULL);
|
return (NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Callback for loop_last_flag. */
|
|
||||||
static void *
|
|
||||||
format_cb_loop_last_flag(struct format_tree *ft)
|
|
||||||
{
|
|
||||||
if (ft->flags & FORMAT_LAST)
|
|
||||||
return (xstrdup("1"));
|
|
||||||
return (xstrdup("0"));
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Callback for mouse_all_flag. */
|
/* Callback for mouse_all_flag. */
|
||||||
static void *
|
static void *
|
||||||
format_cb_mouse_all_flag(struct format_tree *ft)
|
format_cb_mouse_all_flag(struct format_tree *ft)
|
||||||
@@ -3349,9 +3340,6 @@ static const struct format_table_entry format_table[] = {
|
|||||||
{ "last_window_index", FORMAT_TABLE_STRING,
|
{ "last_window_index", FORMAT_TABLE_STRING,
|
||||||
format_cb_last_window_index
|
format_cb_last_window_index
|
||||||
},
|
},
|
||||||
{ "loop_last_flag", FORMAT_TABLE_STRING,
|
|
||||||
format_cb_loop_last_flag
|
|
||||||
},
|
|
||||||
{ "mouse_all_flag", FORMAT_TABLE_STRING,
|
{ "mouse_all_flag", FORMAT_TABLE_STRING,
|
||||||
format_cb_mouse_all_flag
|
format_cb_mouse_all_flag
|
||||||
},
|
},
|
||||||
@@ -4686,7 +4674,7 @@ format_loop_sessions(struct format_expand_state *es, const char *fmt)
|
|||||||
struct evbuffer *buffer;
|
struct evbuffer *buffer;
|
||||||
size_t size;
|
size_t size;
|
||||||
struct session *s, **l;
|
struct session *s, **l;
|
||||||
int i, n, last = 0;
|
int i, n;
|
||||||
|
|
||||||
if (format_choose(es, fmt, &all, &active, 0) != 0) {
|
if (format_choose(es, fmt, &all, &active, 0) != 0) {
|
||||||
all = xstrdup(fmt);
|
all = xstrdup(fmt);
|
||||||
@@ -4707,9 +4695,9 @@ format_loop_sessions(struct format_expand_state *es, const char *fmt)
|
|||||||
use = active;
|
use = active;
|
||||||
else
|
else
|
||||||
use = all;
|
use = all;
|
||||||
if (i == n - 1)
|
nft = format_create(c, item, FORMAT_NONE, ft->flags);
|
||||||
last = FORMAT_LAST;
|
format_add(nft, "loop_index", "%d", i);
|
||||||
nft = format_create(c, item, FORMAT_NONE, ft->flags|last);
|
format_add(nft, "loop_last_flag", "%d", i == n - 1);
|
||||||
format_defaults(nft, ft->c, s, NULL, NULL);
|
format_defaults(nft, ft->c, s, NULL, NULL);
|
||||||
format_copy_state(&next, es, 0);
|
format_copy_state(&next, es, 0);
|
||||||
next.ft = nft;
|
next.ft = nft;
|
||||||
@@ -4801,7 +4789,7 @@ format_loop_windows(struct format_expand_state *es, const char *fmt)
|
|||||||
size_t size;
|
size_t size;
|
||||||
struct winlink *wl, **l;
|
struct winlink *wl, **l;
|
||||||
struct window *w;
|
struct window *w;
|
||||||
int i, n, last = 0;
|
int i, n;
|
||||||
|
|
||||||
if (ft->s == NULL) {
|
if (ft->s == NULL) {
|
||||||
format_log(es, "window loop but no session");
|
format_log(es, "window loop but no session");
|
||||||
@@ -4826,10 +4814,10 @@ format_loop_windows(struct format_expand_state *es, const char *fmt)
|
|||||||
use = active;
|
use = active;
|
||||||
else
|
else
|
||||||
use = all;
|
use = all;
|
||||||
if (i == n - 1)
|
|
||||||
last = FORMAT_LAST;
|
|
||||||
nft = format_create(c, item, FORMAT_WINDOW|w->id,
|
nft = format_create(c, item, FORMAT_WINDOW|w->id,
|
||||||
ft->flags|last);
|
ft->flags);
|
||||||
|
format_add(nft, "loop_index", "%d", i);
|
||||||
|
format_add(nft, "loop_last_flag", "%d", i == n - 1);
|
||||||
format_defaults(nft, ft->c, ft->s, wl, NULL);
|
format_defaults(nft, ft->c, ft->s, wl, NULL);
|
||||||
|
|
||||||
/* Add neighbor window data to the format tree. */
|
/* Add neighbor window data to the format tree. */
|
||||||
@@ -4876,7 +4864,7 @@ format_loop_panes(struct format_expand_state *es, const char *fmt)
|
|||||||
struct evbuffer *buffer;
|
struct evbuffer *buffer;
|
||||||
size_t size;
|
size_t size;
|
||||||
struct window_pane *wp, **l;
|
struct window_pane *wp, **l;
|
||||||
int i, n, last = 0;
|
int i, n;
|
||||||
|
|
||||||
if (ft->w == NULL) {
|
if (ft->w == NULL) {
|
||||||
format_log(es, "pane loop but no window");
|
format_log(es, "pane loop but no window");
|
||||||
@@ -4900,10 +4888,10 @@ format_loop_panes(struct format_expand_state *es, const char *fmt)
|
|||||||
use = active;
|
use = active;
|
||||||
else
|
else
|
||||||
use = all;
|
use = all;
|
||||||
if (i == n - 1)
|
|
||||||
last = FORMAT_LAST;
|
|
||||||
nft = format_create(c, item, FORMAT_PANE|wp->id,
|
nft = format_create(c, item, FORMAT_PANE|wp->id,
|
||||||
ft->flags|last);
|
ft->flags);
|
||||||
|
format_add(nft, "loop_index", "%d", i);
|
||||||
|
format_add(nft, "loop_last_flag", "%d", i == n - 1);
|
||||||
format_defaults(nft, ft->c, ft->s, ft->wl, wp);
|
format_defaults(nft, ft->c, ft->s, ft->wl, wp);
|
||||||
format_copy_state(&next, es, 0);
|
format_copy_state(&next, es, 0);
|
||||||
next.ft = nft;
|
next.ft = nft;
|
||||||
@@ -4938,7 +4926,7 @@ format_loop_clients(struct format_expand_state *es, const char *fmt)
|
|||||||
char *expanded, *value;
|
char *expanded, *value;
|
||||||
struct evbuffer *buffer;
|
struct evbuffer *buffer;
|
||||||
size_t size;
|
size_t size;
|
||||||
int i, n, last = 0;
|
int i, n;
|
||||||
|
|
||||||
buffer = evbuffer_new();
|
buffer = evbuffer_new();
|
||||||
if (buffer == NULL)
|
if (buffer == NULL)
|
||||||
@@ -4948,9 +4936,9 @@ format_loop_clients(struct format_expand_state *es, const char *fmt)
|
|||||||
for (i = 0; i < n; i++) {
|
for (i = 0; i < n; i++) {
|
||||||
c = l[i];
|
c = l[i];
|
||||||
format_log(es, "client loop: %s", c->name);
|
format_log(es, "client loop: %s", c->name);
|
||||||
if (i == n - 1)
|
nft = format_create(c, item, 0, ft->flags);
|
||||||
last = FORMAT_LAST;
|
format_add(nft, "loop_index", "%d", i);
|
||||||
nft = format_create(c, item, 0, ft->flags|last);
|
format_add(nft, "loop_last_flag", "%d", i == n - 1);
|
||||||
format_defaults(nft, c, ft->s, ft->wl, ft->wp);
|
format_defaults(nft, c, ft->s, ft->wl, ft->wp);
|
||||||
format_copy_state(&next, es, 0);
|
format_copy_state(&next, es, 0);
|
||||||
next.ft = nft;
|
next.ft = nft;
|
||||||
|
|||||||
@@ -25,11 +25,10 @@
|
|||||||
#include "tmux.h"
|
#include "tmux.h"
|
||||||
|
|
||||||
#define DEFAULT_SESSION_MENU \
|
#define DEFAULT_SESSION_MENU \
|
||||||
" 'Next' 'n' {switch-client -n}" \
|
" #{S/t:#{?#{&&:#{<:#{loop_index},6},#{!:#{session_active}}},'Switch To #[underscore]#{session_name}' '' {switch-client -t=#{session_id}#} ,}}" \
|
||||||
" 'Previous' 'p' {switch-client -p}" \
|
|
||||||
" ''" \
|
" ''" \
|
||||||
" 'Renumber' 'N' {move-window -r}" \
|
" 'Renumber' 'N' {move-window -r}" \
|
||||||
" 'Rename' 'r' {command-prompt -I \"#S\" {rename-session -- '%%'}}" \
|
" 'Rename' 'r' {command-prompt -I '#S' {rename-session -- '%%'}}" \
|
||||||
" 'Detach' 'd' {detach-client}" \
|
" 'Detach' 'd' {detach-client}" \
|
||||||
" ''" \
|
" ''" \
|
||||||
" 'New Session' 's' {new-session}" \
|
" 'New Session' 's' {new-session}" \
|
||||||
@@ -486,8 +485,8 @@ key_bindings_init(void)
|
|||||||
"bind -n WheelUpStatus { previous-window }",
|
"bind -n WheelUpStatus { previous-window }",
|
||||||
|
|
||||||
/* Mouse button 3 down on status left. */
|
/* Mouse button 3 down on status left. */
|
||||||
"bind -n MouseDown3StatusLeft { display-menu -t= -xM -yW -T '#[align=centre]#{session_name}' " DEFAULT_SESSION_MENU " }",
|
"bind -n MouseDown3StatusLeft { run -C \"display-menu -t= -xM -yW -T '#[align=centre]#{session_name}' " DEFAULT_SESSION_MENU "\" }",
|
||||||
"bind -n M-MouseDown3StatusLeft { display-menu -t= -xM -yW -T '#[align=centre]#{session_name}' " DEFAULT_SESSION_MENU " }",
|
"bind -n M-MouseDown3StatusLeft { run -C \"display-menu -t= -xM -yW -T '#[align=centre]#{session_name}' " DEFAULT_SESSION_MENU "\" }",
|
||||||
|
|
||||||
/* Mouse button 3 down on status line. */
|
/* Mouse button 3 down on status line. */
|
||||||
"bind -n MouseDown3Status { display-menu -t= -xW -yW -T '#[align=centre]#{window_index}:#{window_name}' " DEFAULT_WINDOW_MENU "}",
|
"bind -n MouseDown3Status { display-menu -t= -xW -yW -T '#[align=centre]#{window_index}:#{window_name}' " DEFAULT_WINDOW_MENU "}",
|
||||||
|
|||||||
1
tmux.1
1
tmux.1
@@ -6776,6 +6776,7 @@ The following variables are available, where appropriate:
|
|||||||
.It Li "keypad_flag" Ta "" Ta "Pane keypad flag"
|
.It Li "keypad_flag" Ta "" Ta "Pane keypad flag"
|
||||||
.It Li "last_window_index" Ta "" Ta "Index of last window in session"
|
.It Li "last_window_index" Ta "" Ta "Index of last window in session"
|
||||||
.It Li "line" Ta "" Ta "Line number in the list"
|
.It Li "line" Ta "" Ta "Line number in the list"
|
||||||
|
.It Li "loop_index" Ta "" Ta "Index of item in the W:, P:, S:, or L: loop"
|
||||||
.It Li "loop_last_flag" Ta "" Ta "1 if last window, pane, session, client in the W:, P:, S:, or L: loop"
|
.It Li "loop_last_flag" Ta "" Ta "1 if last window, pane, session, client in the W:, P:, S:, or L: loop"
|
||||||
.It Li "mouse_all_flag" Ta "" Ta "Pane mouse all flag"
|
.It Li "mouse_all_flag" Ta "" Ta "Pane mouse all flag"
|
||||||
.It Li "mouse_any_flag" Ta "" Ta "Pane mouse any flag"
|
.It Li "mouse_any_flag" Ta "" Ta "Pane mouse any flag"
|
||||||
|
|||||||
Reference in New Issue
Block a user