mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-25 12:23:09 +00:00
replace __fish_urlencode with string escape
We now have a builtin that can do URL escaping so use it. I can't find any uses of our private `__fish_urlencode` function in any Oh-My-Fish or Fisherman code so remove it.
This commit is contained in:
parent
f3cb625802
commit
bb29f9f990
12 changed files with 2 additions and 66 deletions
|
@ -167,7 +167,7 @@ In general, special characters are special by default, so `a+` matches one or mo
|
||||||
\endfish
|
\endfish
|
||||||
|
|
||||||
\fish{cli-dark}
|
\fish{cli-dark}
|
||||||
>_ string escape --style=var 'a1 b2'\u6161
|
>_ string escape --style=var 'a1 b2'\\u6161
|
||||||
<bs>a1_20b2__c_E6_85_A1</bs>
|
<bs>a1_20b2__c_E6_85_A1</bs>
|
||||||
\endfish
|
\endfish
|
||||||
|
|
||||||
|
|
5
po/de.po
5
po/de.po
|
@ -61324,11 +61324,6 @@ msgstr ""
|
||||||
msgid "Update man-page based completions"
|
msgid "Update man-page based completions"
|
||||||
msgstr "Befehlsspezifische Erweiterungen bearbeiten"
|
msgstr "Befehlsspezifische Erweiterungen bearbeiten"
|
||||||
|
|
||||||
#: /tmp/fish/implicit/share/functions/__fish_urlencode.fish:1
|
|
||||||
#, fuzzy
|
|
||||||
msgid "URL-encode stdin"
|
|
||||||
msgstr "Standardeingabe umbenennen"
|
|
||||||
|
|
||||||
#: /tmp/fish/implicit/share/functions/__fish_use_subcommand.fish:1
|
#: /tmp/fish/implicit/share/functions/__fish_use_subcommand.fish:1
|
||||||
#, fuzzy
|
#, fuzzy
|
||||||
msgid "Test if a non-switch argument has been given in the current commandline"
|
msgid "Test if a non-switch argument has been given in the current commandline"
|
||||||
|
|
4
po/en.po
4
po/en.po
|
@ -8114,10 +8114,6 @@ msgstr "Show current path"
|
||||||
msgid "Test if the token under the cursor matches the specified wildcard"
|
msgid "Test if the token under the cursor matches the specified wildcard"
|
||||||
msgstr "Test if the token under the cursor matches the specified wildcard"
|
msgstr "Test if the token under the cursor matches the specified wildcard"
|
||||||
|
|
||||||
#: share/functions/__fish_urlencode.fish:1
|
|
||||||
msgid "URL-encode stdin"
|
|
||||||
msgstr "URL-encode stdin"
|
|
||||||
|
|
||||||
#: share/functions/__terlar_git_prompt.fish:23
|
#: share/functions/__terlar_git_prompt.fish:23
|
||||||
msgid "Write out the git prompt"
|
msgid "Write out the git prompt"
|
||||||
msgstr "Write out the git prompt"
|
msgstr "Write out the git prompt"
|
||||||
|
|
4
po/fr.po
4
po/fr.po
|
@ -60024,10 +60024,6 @@ msgstr ""
|
||||||
msgid "Update man-page based completions"
|
msgid "Update man-page based completions"
|
||||||
msgstr "Éditer les complétions spécifiques aux commandes"
|
msgstr "Éditer les complétions spécifiques aux commandes"
|
||||||
|
|
||||||
#: /tmp/fish/implicit/share/functions/__fish_urlencode.fish:1
|
|
||||||
msgid "URL-encode stdin"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: /tmp/fish/implicit/share/functions/__fish_use_subcommand.fish:1
|
#: /tmp/fish/implicit/share/functions/__fish_use_subcommand.fish:1
|
||||||
#, fuzzy
|
#, fuzzy
|
||||||
msgid "Test if a non-switch argument has been given in the current commandline"
|
msgid "Test if a non-switch argument has been given in the current commandline"
|
||||||
|
|
4
po/nb.po
4
po/nb.po
|
@ -56722,10 +56722,6 @@ msgstr ""
|
||||||
msgid "Update man-page based completions"
|
msgid "Update man-page based completions"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: /tmp/fish/implicit/share/functions/__fish_urlencode.fish:1
|
|
||||||
msgid "URL-encode stdin"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: /tmp/fish/implicit/share/functions/__fish_use_subcommand.fish:1
|
#: /tmp/fish/implicit/share/functions/__fish_use_subcommand.fish:1
|
||||||
msgid "Test if a non-switch argument has been given in the current commandline"
|
msgid "Test if a non-switch argument has been given in the current commandline"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
4
po/nn.po
4
po/nn.po
|
@ -56722,10 +56722,6 @@ msgstr ""
|
||||||
msgid "Update man-page based completions"
|
msgid "Update man-page based completions"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: /tmp/fish/implicit/share/functions/__fish_urlencode.fish:1
|
|
||||||
msgid "URL-encode stdin"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: /tmp/fish/implicit/share/functions/__fish_use_subcommand.fish:1
|
#: /tmp/fish/implicit/share/functions/__fish_use_subcommand.fish:1
|
||||||
msgid "Test if a non-switch argument has been given in the current commandline"
|
msgid "Test if a non-switch argument has been given in the current commandline"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
4
po/pl.po
4
po/pl.po
|
@ -57143,10 +57143,6 @@ msgstr ""
|
||||||
msgid "Update man-page based completions"
|
msgid "Update man-page based completions"
|
||||||
msgstr "Edytuj sugestie do określonej komendy"
|
msgstr "Edytuj sugestie do określonej komendy"
|
||||||
|
|
||||||
#: /tmp/fish/implicit/share/functions/__fish_urlencode.fish:1
|
|
||||||
msgid "URL-encode stdin"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: /tmp/fish/implicit/share/functions/__fish_use_subcommand.fish:1
|
#: /tmp/fish/implicit/share/functions/__fish_use_subcommand.fish:1
|
||||||
msgid "Test if a non-switch argument has been given in the current commandline"
|
msgid "Test if a non-switch argument has been given in the current commandline"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
|
@ -61774,11 +61774,6 @@ msgstr ""
|
||||||
msgid "Update man-page based completions"
|
msgid "Update man-page based completions"
|
||||||
msgstr "Edit command specific completions"
|
msgstr "Edit command specific completions"
|
||||||
|
|
||||||
#: /tmp/fish/implicit/share/functions/__fish_urlencode.fish:1
|
|
||||||
#, fuzzy
|
|
||||||
msgid "URL-encode stdin"
|
|
||||||
msgstr "Rename stdin"
|
|
||||||
|
|
||||||
#: /tmp/fish/implicit/share/functions/__fish_use_subcommand.fish:1
|
#: /tmp/fish/implicit/share/functions/__fish_use_subcommand.fish:1
|
||||||
#, fuzzy
|
#, fuzzy
|
||||||
msgid "Test if a non-switch argument has been given in the current commandline"
|
msgid "Test if a non-switch argument has been given in the current commandline"
|
||||||
|
|
4
po/sv.po
4
po/sv.po
|
@ -53577,10 +53577,6 @@ msgstr ""
|
||||||
msgid "Update man-page based completions"
|
msgid "Update man-page based completions"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: /tmp/fish/implicit/share/functions/__fish_urlencode.fish:1
|
|
||||||
msgid "URL-encode stdin"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: /tmp/fish/implicit/share/functions/__fish_use_subcommand.fish:1
|
#: /tmp/fish/implicit/share/functions/__fish_use_subcommand.fish:1
|
||||||
msgid "Test if a non-switch argument has been given in the current commandline"
|
msgid "Test if a non-switch argument has been given in the current commandline"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
|
@ -57099,10 +57099,6 @@ msgstr ""
|
||||||
msgid "Update man-page based completions"
|
msgid "Update man-page based completions"
|
||||||
msgstr "编辑命令相关的补全"
|
msgstr "编辑命令相关的补全"
|
||||||
|
|
||||||
#: /tmp/fish/implicit/share/functions/__fish_urlencode.fish:1
|
|
||||||
msgid "URL-encode stdin"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: /tmp/fish/implicit/share/functions/__fish_use_subcommand.fish:1
|
#: /tmp/fish/implicit/share/functions/__fish_use_subcommand.fish:1
|
||||||
msgid "Test if a non-switch argument has been given in the current commandline"
|
msgid "Test if a non-switch argument has been given in the current commandline"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
|
@ -262,7 +262,7 @@ function __fish_config_interactive -d "Initializations that should be performed
|
||||||
status --is-command-substitution
|
status --is-command-substitution
|
||||||
or test -n "$INSIDE_EMACS"
|
or test -n "$INSIDE_EMACS"
|
||||||
and return
|
and return
|
||||||
printf \e\]7\;file://\%s\%s\a (hostname) (echo -n $PWD | __fish_urlencode)
|
printf \e\]7\;file://\%s\%s\a (hostname) (string escape --style=url $PWD)
|
||||||
end
|
end
|
||||||
__update_cwd_osc # Run once because we might have already inherited a PWD from an old tab
|
__update_cwd_osc # Run once because we might have already inherited a PWD from an old tab
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,26 +0,0 @@
|
||||||
function __fish_urlencode --description "URL-encode stdin"
|
|
||||||
set -l join ''
|
|
||||||
set -l chars
|
|
||||||
# Set locale to C and IFS to "" in order to split a line into bytes.
|
|
||||||
while begin
|
|
||||||
set -lx LC_ALL C
|
|
||||||
set -lx IFS ''
|
|
||||||
read -az chars
|
|
||||||
end
|
|
||||||
printf '%s' $join
|
|
||||||
# chomp off a trailing newline
|
|
||||||
if test "$chars[-1]" = \n
|
|
||||||
set -e chars[-1]
|
|
||||||
set join '%0A%00'
|
|
||||||
else
|
|
||||||
set join '%00'
|
|
||||||
end
|
|
||||||
for c in $chars
|
|
||||||
if string match -q -r '[/._~A-Za-z0-9-]' $c
|
|
||||||
printf '%s' $c
|
|
||||||
else
|
|
||||||
printf '%%%02X' "'$c"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
Loading…
Reference in a new issue