Skip to content

Commit 3ea5b9f

Browse files
author
Bruno Sutic
committed
Support *the* latest tmux version
1 parent 9d61936 commit 3ea5b9f

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Changelog
22

33
### master
4+
- update to support \*THE\* latest tmux version
45
- bugfix for `prefix + R` key binding
56

67
### v2.2.0, 2015-02-10

sensible.tmux

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
44

55
ALMOST_SENSIBLE_OPTION="@almost-sensible"
66

7+
# used to match output from `tmux list-keys`
8+
KEY_BINDING_REGEX="bind-key[[:space:]]\+\(-r[[:space:]]\+\)\?\(-T prefix[[:space:]]\+\)\?"
9+
710
is_osx() {
811
local platform=$(uname)
912
[ "$platform" == "Darwin" ]
@@ -41,7 +44,7 @@ server_option_value_not_changed() {
4144

4245
key_binding_not_set() {
4346
local key="$1"
44-
if $(tmux list-keys | grep -q "bind-key[[:space:]]\+\(-r[[:space:]]\+\)\?${key}[[:space:]]"); then
47+
if $(tmux list-keys | grep -q "${KEY_BINDING_REGEX}${key}[[:space:]]"); then
4548
return 1
4649
else
4750
return 0
@@ -51,7 +54,7 @@ key_binding_not_set() {
5154
key_binding_not_changed() {
5255
local key="$1"
5356
local default_value="$2"
54-
if $(tmux list-keys | grep -q "bind-key[[:space:]]\+${key}[[:space:]]\+${default_value}"); then
57+
if $(tmux list-keys | grep -q "${KEY_BINDING_REGEX}${key}[[:space:]]\+${default_value}"); then
5558
# key still has the default binding
5659
return 0
5760
else

0 commit comments

Comments
 (0)