mirror of
				https://github.com/tmux-plugins/tmux-sensible.git
				synced 2025-11-04 08:36:03 +00:00 
			
		
		
		
	Support *the* latest tmux version
This commit is contained in:
		@@ -1,6 +1,7 @@
 | 
				
			|||||||
# Changelog
 | 
					# Changelog
 | 
				
			||||||
 | 
					
 | 
				
			||||||
### master
 | 
					### master
 | 
				
			||||||
 | 
					- update to support \*THE\* latest tmux version
 | 
				
			||||||
- bugfix for `prefix + R` key binding
 | 
					- bugfix for `prefix + R` key binding
 | 
				
			||||||
 | 
					
 | 
				
			||||||
### v2.2.0, 2015-02-10
 | 
					### v2.2.0, 2015-02-10
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -4,6 +4,9 @@ CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
ALMOST_SENSIBLE_OPTION="@almost-sensible"
 | 
					ALMOST_SENSIBLE_OPTION="@almost-sensible"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# used to match output from `tmux list-keys`
 | 
				
			||||||
 | 
					KEY_BINDING_REGEX="bind-key[[:space:]]\+\(-r[[:space:]]\+\)\?\(-T prefix[[:space:]]\+\)\?"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
is_osx() {
 | 
					is_osx() {
 | 
				
			||||||
	local platform=$(uname)
 | 
						local platform=$(uname)
 | 
				
			||||||
	[ "$platform" == "Darwin" ]
 | 
						[ "$platform" == "Darwin" ]
 | 
				
			||||||
@@ -41,7 +44,7 @@ server_option_value_not_changed() {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
key_binding_not_set() {
 | 
					key_binding_not_set() {
 | 
				
			||||||
	local key="$1"
 | 
						local key="$1"
 | 
				
			||||||
	if $(tmux list-keys | grep -q "bind-key[[:space:]]\+\(-r[[:space:]]\+\)\?${key}[[:space:]]"); then
 | 
						if $(tmux list-keys | grep -q "${KEY_BINDING_REGEX}${key}[[:space:]]"); then
 | 
				
			||||||
		return 1
 | 
							return 1
 | 
				
			||||||
	else
 | 
						else
 | 
				
			||||||
		return 0
 | 
							return 0
 | 
				
			||||||
@@ -51,7 +54,7 @@ key_binding_not_set() {
 | 
				
			|||||||
key_binding_not_changed() {
 | 
					key_binding_not_changed() {
 | 
				
			||||||
	local key="$1"
 | 
						local key="$1"
 | 
				
			||||||
	local default_value="$2"
 | 
						local default_value="$2"
 | 
				
			||||||
	if $(tmux list-keys | grep -q "bind-key[[:space:]]\+${key}[[:space:]]\+${default_value}"); then
 | 
						if $(tmux list-keys | grep -q "${KEY_BINDING_REGEX}${key}[[:space:]]\+${default_value}"); then
 | 
				
			||||||
		# key still has the default binding
 | 
							# key still has the default binding
 | 
				
			||||||
		return 0
 | 
							return 0
 | 
				
			||||||
	else
 | 
						else
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user