Created
August 15, 2011 16:35
-
-
Save miaout17/1147142 to your computer and use it in GitHub Desktop.
tmux-unbind-all-crash.patch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set-option -g prefix C-a | |
# If we perform "unbind-key a" within a keybind | |
# It will have very high probability to crash | |
bind-key u unbind-key -a | |
# Following code shows a general use case: | |
# * I want to unbind all keys in .tmux.conf, then bind everything by myself | |
# * I need a hotkey to reload my .tmux.conf script | |
# When I try to reload, tmux server crashes. | |
unbind-key -a | |
bind-key r source-file ~/.tmux.conf | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Index: cmd-unbind-key.c | |
=================================================================== | |
--- cmd-unbind-key.c (revision 2576) | |
+++ cmd-unbind-key.c (working copy) | |
@@ -59,9 +59,7 @@ | |
if (args_has(args, 'a')) { | |
while (!SPLAY_EMPTY(&key_bindings)) { | |
bd = SPLAY_ROOT(&key_bindings); | |
- SPLAY_REMOVE(key_bindings, &key_bindings, bd); | |
- cmd_list_free(bd->cmdlist); | |
- xfree(bd); | |
+ key_bindings_remove(bd->key); | |
} | |
return (0); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment