lib: add ability to disable magic functions
Fixes #5499
Fixes #5569
Fixes #6338
Fixes #6654
Fixes #6255
Fixes #7632
Closes #7763
Co-authored-by: Daniel Galán y Martins <git@galan.de>
Diff
1diff --git a/lib/misc.zsh b/lib/misc.zsh
2index b30822b509f7755bd351e6c52d38447df7026ef2..40ffa479da106a4797b47eb77885506c933f3657 100644
3--- a/lib/misc.zsh
4+++ b/lib/misc.zsh
5@@ -1,7 +1,7 @@
6-## Load smart urls if available
7-# bracketed-paste-magic is known buggy in zsh 5.1.1 (only), so skip it there; see #4434
8 autoload -Uz is-at-least
9-if [[ $ZSH_VERSION != 5.1.1 ]]; then
10+
11+# *-magic is known buggy in some versions; disable if so
12+if [[ $DISABLE_MAGIC_FUNCTIONS != true ]]; then
13 for d in $fpath; do
14 if [[ -e "$d/url-quote-magic" ]]; then
15 if is-at-least 5.1; then
16diff --git a/templates/zshrc.zsh-template b/templates/zshrc.zsh-template
17index 453daf8a2ce3b5bf066ef522c388f41ff472a75e..3cc5ad46c75cfd0cbdce394ea5acf0736e262a2f 100644
18--- a/templates/zshrc.zsh-template
19+++ b/templates/zshrc.zsh-template
20@@ -32,6 +32,9 @@ ZSH_THEME="robbyrussell"
21 # Uncomment the following line to change how often to auto-update (in days).
22 # export UPDATE_ZSH_DAYS=13
2324+# Uncomment the following line if pasting URLs and other text is messed up.
25+# DISABLE_MAGIC_FUNCTIONS=true
26+
27 # Uncomment the following line to disable colors in ls.
28 # DISABLE_LS_COLORS="true"
29