Bug fix: fish_config/bindings display ESC as "ALT-e"

Fixes #3286
This commit is contained in:
Jin Liu 2016-08-04 17:03:22 +08:00 committed by Kurtis Rader
parent 744da2cab2
commit ccd62ff44b

View File

@ -409,6 +409,8 @@ class BindingParser:
self.unget_char() self.unget_char()
self.unget_char() self.unget_char()
alt = True alt = True
elif d == '\0':
result += 'ESC'
else: else:
alt = True alt = True
self.unget_char() self.unget_char()
@ -730,7 +732,7 @@ class FishConfigHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
for x,y in zip(haystack, needle): for x,y in zip(haystack, needle):
bits |= ord(x) ^ ord(y) bits |= ord(x) ^ ord(y)
return bits == 0 return bits == 0
def font_size_for_ansi_prompt(self, prompt_demo_ansi): def font_size_for_ansi_prompt(self, prompt_demo_ansi):
width = ansi_prompt_line_width(prompt_demo_ansi) width = ansi_prompt_line_width(prompt_demo_ansi)
# Pick a font size # Pick a font size