* 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) - hardcode a use of gawk (for hex calculations)
* usr/share/doc/byobu/help.tmux.txt: LP: #1143342 * usr/share/doc/byobu/help.tmux.txt: LP: #1143342
- rephrase window rename help text - 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 -- Dustin Kirkland <kirkland@ubuntu.com> Tue, 07 May 2013 22:01:40 -0500

View file

@ -265,16 +265,20 @@ def getesckey():
line = "" line = ""
if BYOBU_BACKEND == "tmux": if BYOBU_BACKEND == "tmux":
path = BYOBU_CONFIG_DIR + '/keybindings.tmux' path = BYOBU_CONFIG_DIR + '/keybindings.tmux'
for l in open(path): if os.path.exists(path):
if l.startswith("set -g prefix "): for l in open(path):
line = l if l.startswith("set -g prefix "):
line = l
else:
return DEF_ESC
else: else:
path = BYOBU_CONFIG_DIR + '/keybindings' path = BYOBU_CONFIG_DIR + '/keybindings'
for l in open(path): if os.path.exists(path):
if l.startswith("escape "): for l in open(path):
line = l if l.startswith("escape "):
if not os.path.exists(path): line = l
return DEF_ESC else:
return DEF_ESC
if line == "": if line == "":
return DEF_ESC return DEF_ESC
esc = line[line.find('^') + 1] esc = line[line.find('^') + 1]