mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-26 12:53:13 +00:00
web_config: set new prompts via JSON instead of URI-encoded
Fixes problems with encoding and decoding Unicode from URL-encoded strings, which was impossible to get right in Python 2.
This commit is contained in:
parent
d17ba69f9e
commit
78dfc57b1e
2 changed files with 3 additions and 3 deletions
|
@ -140,7 +140,7 @@ controllers.controller("promptController", function($scope, $http) {
|
|||
}
|
||||
|
||||
$scope.setNewPrompt = function(selectedPrompt) {
|
||||
$http.post("set_prompt/","what=" + encodeURIComponent(selectedPrompt.function), { headers: {'Content-Type': 'application/x-www-form-urlencoded'} }).success(function(data, status, headers, config){
|
||||
$http.post("set_prompt/", {'fish_prompt': selectedPrompt.function,}).success(function(data, status, headers, config){
|
||||
|
||||
// Update attributes of current prompt and select it
|
||||
$scope.samplePrompts[0].demo = selectedPrompt.demo;
|
||||
|
|
|
@ -816,8 +816,8 @@ class FishConfigHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
|
|||
else:
|
||||
output = ["Unable to delete history item"]
|
||||
elif p == '/set_prompt/':
|
||||
what = postvars.get('what')
|
||||
if self.do_set_prompt_function(what[0]):
|
||||
what = postvars.get('fish_prompt')
|
||||
if self.do_set_prompt_function(what):
|
||||
output = ["OK"]
|
||||
else:
|
||||
output = ["Unable to set prompt"]
|
||||
|
|
Loading…
Reference in a new issue