* usr/bin/byobu-config: LP: #1166058

- handle non-existant keybindings file
This commit is contained in:
Dustin Kirkland 2013-05-08 13:27:10 -05:00
commit a3b575654c
2 changed files with 14 additions and 8 deletions

2
debian/changelog vendored
View file

@ -8,6 +8,8 @@ byobu (5.40) unreleased; urgency=low
- hardcode a use of gawk (for hex calculations)
* usr/share/doc/byobu/help.tmux.txt: LP: #1143342
- rephrase window rename help text
* usr/bin/byobu-config: LP: #1166058
- handle non-existant keybindings file
-- Dustin Kirkland <kirkland@ubuntu.com> Tue, 07 May 2013 22:01:40 -0500

View file

@ -265,15 +265,19 @@ def getesckey():
line = ""
if BYOBU_BACKEND == "tmux":
path = BYOBU_CONFIG_DIR + '/keybindings.tmux'
if os.path.exists(path):
for l in open(path):
if l.startswith("set -g prefix "):
line = l
else:
return DEF_ESC
else:
path = BYOBU_CONFIG_DIR + '/keybindings'
if os.path.exists(path):
for l in open(path):
if l.startswith("escape "):
line = l
if not os.path.exists(path):
else:
return DEF_ESC
if line == "":
return DEF_ESC