mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-04-29 08:41:15 -03:00
webconfig: Use history -z
This did some weird stuff with \x1e. [ci skip]
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user