summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/cmd-select-pane.c
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2019-06-20 11:59:59 +0000
committernicm <nicm@openbsd.org>2019-06-20 11:59:59 +0000
commit6e0f28f868d9cdb38e53237c697fe7731f7e850d (patch)
tree5517a20c5217760c5932640f711cc28bf95a6ea7 /usr.bin/tmux/cmd-select-pane.c
parentTell a bit about automatic mode; ok jmc@ (diff)
downloadwireguard-openbsd-6e0f28f868d9cdb38e53237c697fe7731f7e850d.tar.xz
wireguard-openbsd-6e0f28f868d9cdb38e53237c697fe7731f7e850d.zip
Add a per-pane option set. Pane options inherit from window options (so
there should be no change to existing behaviour) and are set and shown with set-option -p and show-options -p. Change remain-on-exit and window-style/window-active-style to be pane options (some others will be changed later). This makes select-pane -P and -g unnecessary so no longer document them (they still work) and no longer document set-window-option and show-window-options in favour of set-option -w and show-options -w.
Diffstat (limited to 'usr.bin/tmux/cmd-select-pane.c')
-rw-r--r--usr.bin/tmux/cmd-select-pane.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/usr.bin/tmux/cmd-select-pane.c b/usr.bin/tmux/cmd-select-pane.c
index d585191b115..c74b6715531 100644
--- a/usr.bin/tmux/cmd-select-pane.c
+++ b/usr.bin/tmux/cmd-select-pane.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd-select-pane.c,v 1.50 2019/04/30 06:21:30 nicm Exp $ */
+/* $OpenBSD: cmd-select-pane.c,v 1.51 2019/06/20 11:59:59 nicm Exp $ */
/*
* Copyright (c) 2009 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -33,8 +33,8 @@ const struct cmd_entry cmd_select_pane_entry = {
.name = "select-pane",
.alias = "selectp",
- .args = { "DdegLlMmP:RT:t:U", 0, 0 },
- .usage = "[-DdegLlMmRU] [-P style] [-T title] " CMD_TARGET_PANE_USAGE,
+ .args = { "DdegLlMmP:RT:t:U", 0, 0 }, /* -P and -g deprecated */
+ .usage = "[-DdeLlMmRU] [-T title] " CMD_TARGET_PANE_USAGE,
.target = { 't', CMD_FIND_PANE, 0 },
@@ -90,9 +90,10 @@ cmd_select_pane_exec(struct cmd *self, struct cmdq_item *item)
struct window *w = wl->window;
struct session *s = item->target.s;
struct window_pane *wp = item->target.wp, *lastwp, *markedwp;
- struct style *sy = &wp->style;
char *pane_title;
const char *style;
+ struct style *sy;
+ struct options_entry *o;
if (self->entry == &cmd_last_pane_entry || args_has(args, 'l')) {
lastwp = w->last;
@@ -144,15 +145,18 @@ cmd_select_pane_exec(struct cmd *self, struct cmdq_item *item)
if (args_has(self->args, 'P') || args_has(self->args, 'g')) {
if ((style = args_get(args, 'P')) != NULL) {
- style_set(sy, &grid_default_cell);
- if (style_parse(sy, &grid_default_cell, style) == -1) {
+ o = options_set_style(wp->options, "window-style", 0,
+ style);
+ if (o == NULL) {
cmdq_error(item, "bad style: %s", style);
return (CMD_RETURN_ERROR);
}
- wp->flags |= PANE_REDRAW;
+ wp->flags |= (PANE_REDRAW|PANE_STYLECHANGED);
}
- if (args_has(self->args, 'g'))
+ if (args_has(self->args, 'g')) {
+ sy = options_get_style(wp->options, "window-style");
cmdq_print(item, "%s", style_tostring(sy));
+ }
return (CMD_RETURN_NORMAL);
}