From d7dac4d07718c875c1ac758c5f2b7b1378f6ef59 Mon Sep 17 00:00:00 2001 From: Fabian Homborg Date: Wed, 16 Jan 2019 09:31:03 +0100 Subject: [PATCH] webconfig: Use history -z This did some weird stuff with \x1e. [ci skip] --- share/tools/web_config/webconfig.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/share/tools/web_config/webconfig.py b/share/tools/web_config/webconfig.py index 95e3e9d4b..7703532e7 100755 --- a/share/tools/web_config/webconfig.py +++ b/share/tools/web_config/webconfig.py @@ -742,10 +742,9 @@ class FishConfigHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler): return [binding.get_json_obj() for binding in bindings] def do_get_history(self): - # Use \x1e ("record separator") to distinguish between history items. - # The first backslash is so Python passes one backslash to fish. - out, err = run_fish_cmd('for val in $history; echo -n $val \\x1e; end') - result = out.split(' \x1e') + # Use NUL to distinguish between history items. + out, err = run_fish_cmd('builtin history -z') + result = out.split('\0') if result: result.pop() # trim off the trailing element return result