summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/key-bindings.c
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2019-05-10 18:04:06 +0000
committernicm <nicm@openbsd.org>2019-05-10 18:04:06 +0000
commit3546f4c9d7222217295f53482140bcb81efab8e5 (patch)
tree6120d1b07ee95901b9a5c9d120fbc31ada8b32c3 /usr.bin/tmux/key-bindings.c
parenttweak previous: fix three wrong macros and one missing macro (diff)
downloadwireguard-openbsd-3546f4c9d7222217295f53482140bcb81efab8e5.tar.xz
wireguard-openbsd-3546f4c9d7222217295f53482140bcb81efab8e5.zip
Add support for simple menus usable with mouse or keyboard. New command
display-menu shows a menu (bound to the mouse on status line by default) and a couple of extra formats for the default menus.
Diffstat (limited to 'usr.bin/tmux/key-bindings.c')
-rw-r--r--usr.bin/tmux/key-bindings.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/usr.bin/tmux/key-bindings.c b/usr.bin/tmux/key-bindings.c
index c484f2301c2..375b939d775 100644
--- a/usr.bin/tmux/key-bindings.c
+++ b/usr.bin/tmux/key-bindings.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: key-bindings.c,v 1.90 2019/05/09 13:12:59 nicm Exp $ */
+/* $OpenBSD: key-bindings.c,v 1.91 2019/05/10 18:04:06 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -271,6 +271,7 @@ key_bindings_init(void)
"bind -r C-Down resize-pane -D",
"bind -r C-Left resize-pane -L",
"bind -r C-Right resize-pane -R",
+
"bind -n MouseDown1Pane select-pane -t=\\; send-keys -M",
"bind -n MouseDrag1Border resize-pane -M",
"bind -n MouseDown1Status select-window -t=",
@@ -279,6 +280,10 @@ key_bindings_init(void)
"bind -n MouseDrag1Pane if -Ft= '#{mouse_any_flag}' 'if -Ft= \"#{pane_in_mode}\" \"copy-mode -M\" \"send-keys -M\"' 'copy-mode -M'",
"bind -n MouseDown3Pane if-shell -Ft= '#{mouse_any_flag}' 'select-pane -t=; send-keys -M' 'select-pane -mt='",
"bind -n WheelUpPane if-shell -Ft= '#{mouse_any_flag}' 'send-keys -M' 'if -Ft= \"#{pane_in_mode}\" \"send-keys -M\" \"copy-mode -et=\"'",
+ "bind -n MouseDown3StatusRight display-menu -t= -xM -yS -F -M \"#{client_menu}\" -T \"#[align=centre]#{client_name}\"",
+ "bind -n MouseDown3StatusLeft display-menu -t= -xM -yS -F -M \"#{session_menu}\" -T \"#[align=centre]#{session_name}\"",
+ "bind -n MouseDown3Status display-menu -t= -xW -yS -F -M \"#{window_menu}\" -T \"#[align=centre]#{window_index}:#{window_name}\"",
+ "bind -n M-MouseDown3Pane display-menu -t= -xM -yM -F -M \"#{pane_menu}\" -T \"#[align=centre]#{pane_index} (#{pane_id})\"",
"bind -Tcopy-mode C-Space send -X begin-selection",
"bind -Tcopy-mode C-a send -X start-of-line",