zsh-users / zsh-autosuggestions

Fish-like autosuggestions for zsh
MIT License
30.3k stars 1.85k forks source link

auto suggestions from history have weird prefixes with underscores ex: __1__/{real_directory} #768

Closed ashtonian closed 8 months ago

ashtonian commented 8 months ago

Describe the bug

Sometimes path auto suggestions have weird underscores in the path like #/{actual_directory}, while inconsistent with cd and other commands, it happens every time with jump.

I'm using omz + power line, with zsh-autosuggestions, history, jump. Autosuggest is suggesting it as seen in the debug output but I'm not sure why. Here is the output when typing j proj.

 j+_zsh_autosuggest_async_response:1> emulate -L zsh               INT ✘  00:46:48   ▓▒░
+_zsh_autosuggest_async_response:3> local suggestion
+_zsh_autosuggest_async_response:5> [[ -z '' ]]
+_zsh_autosuggest_async_response:7> IFS='' +_zsh_autosuggest_async_response:7> read -rd '' -u 16 suggestion
+_zsh_autosuggest_async_response:8> zle autosuggest-suggest -- 'j  proj'
j+_zsh_autosuggest_async_response:15> zle -F 16
j +_zsh_autosuggest_async_response:1> emulate -L zsh
+_zsh_autosuggest_async_response:3> local suggestion
+_zsh_autosuggest_async_response:5> [[ -z '' ]]
+_zsh_autosuggest_async_response:7> IFS='' +_zsh_autosuggest_async_response:7> read -rd '' -u 18 suggestion
+_zsh_autosuggest_async_response:8> zle autosuggest-suggest -- 'j  proj'
+_zsh_autosuggest_async_response:15> zle -F 18
p+_zsh_autosuggest_async_response:1> emulate -L zsh
+_zsh_autosuggest_async_response:3> local suggestion
+_zsh_autosuggest_async_response:5> [[ -z '' ]]
+_zsh_autosuggest_async_response:7> IFS='' +_zsh_autosuggest_async_response:7> read -rd '' -u 16 suggestion
+_zsh_autosuggest_async_response:8> zle autosuggest-suggest -- 'j p__1__/Users/ashtonian/.oh-my-zsh/custom/plugins/fast-alias-tips'
+_zsh_autosuggest_async_response:15> zle -F 16s/fast-alias-tips
+_p9k_worker_receive:1> eval $'emulate -L zsh -o no_hist_expand -o extended_glob -o no_prompt_bang -o prompt_percent -o no_prompt_subst -o no_aliases -o no_bg_nice -o typeset_silent -o no_rematch_pcre\n  (( $+__p9k_trapped )) || { local -i __p9k_trapped; trap : INT; trap "trap ${(q)__p9k_trapint:--} INT" EXIT }\n  local -a match reply mbegin mend\n  local -i MBEGIN MEND OPTIND\n  local MATCH REPLY OPTARG IFS=$\' \\t\\n\\0\'; [[ $langinfo[CODESET] != (utf|UTF)(-|)8 ]] && _p9k_init_locale && { [[ -n $LC_ALL ]] && local LC_ALL=$__p9k_locale || local LC_CTYPE=$__p9k_locale }'
+(eval):1> emulate -L zsh -o no_hist_expand -o extended_glob -o no_prompt_bang -o prompt_percent -o no_prompt_subst -o no_aliases -o no_bg_nice -o typeset_silent -o no_rematch_pcre
+(eval):2> ((  0  ))
+(eval):2> local -i __p9k_trapped
+(eval):2> trap : INT
+(eval):2> trap 'trap _p9k_trapint\;\ return\ 130 INT' EXIT
+(eval):3> local -a match reply mbegin mend
+(eval):4> local -i MBEGIN MEND OPTIND
+(eval):5> local MATCH REPLY OPTARG IFS=$' \t\n\C-@'
+(eval):5> [[ UTF-8 != (utf|UTF)(-|)8 ]]
+_p9k_worker_receive:3> [[ -z 12 ]]
+_p9k_worker_receive:6> ((  1 <= 1  ))
+_p9k_worker_receive:8> local buf resp
+_p9k_worker_receive:10> [[ -t 12 ]]
+_p9k_worker_receive:11> sysread -i 12 -t 0 'buf[$#buf+1]'
+_p9k_worker_receive:12> [[ $'\C-E' == *[^]# ]]
+_p9k_worker_receive:19> local -i reset max_reset
+_p9k_worker_receive:53> ((  max_reset == 2  ))
+_p9k_worker_receive:58> ((  max_reset  ))
+_p9k_worker_receive:59> return 0
+_p9k_worker_receive:61> ((  0  ))
+-zsh:1> trap '_p9k_trapint; return 130' INT
pr+_zsh_autosuggest_async_response:1> emulate -L zsh            INT ✘  00:46:48   ▓▒░
+_zsh_autosuggest_async_response:3> local suggestion
+_zsh_autosuggest_async_response:5> [[ -z '' ]]
+_zsh_autosuggest_async_response:7> IFS='' +_zsh_autosuggest_async_response:7> read -rd '' -u 16 suggestion
+_zsh_autosuggest_async_response:8> zle autosuggest-suggest -- 'j pr'
+_zsh_autosuggest_async_response:15> zle -F 16
+_p9k_worker_receive:1> eval $'emulate -L zsh -o no_hist_expand -o extended_glob -o no_prompt_bang -o prompt_percent -o no_prompt_subst -o no_aliases -o no_bg_nice -o typeset_silent -o no_rematch_pcre\n  (( $+__p9k_trapped )) || { local -i __p9k_trapped; trap : INT; trap "trap ${(q)__p9k_trapint:--} INT" EXIT }\n  local -a match reply mbegin mend\n  local -i MBEGIN MEND OPTIND\n  local MATCH REPLY OPTARG IFS=$\' \\t\\n\\0\'; [[ $langinfo[CODESET] != (utf|UTF)(-|)8 ]] && _p9k_init_locale && { [[ -n $LC_ALL ]] && local LC_ALL=$__p9k_locale || local LC_CTYPE=$__p9k_locale }'
+(eval):1> emulate -L zsh -o no_hist_expand -o extended_glob -o no_prompt_bang -o prompt_percent -o no_prompt_subst -o no_aliases -o no_bg_nice -o typeset_silent -o no_rematch_pcre
+(eval):2> ((  0  ))
+(eval):2> local -i __p9k_trapped
+(eval):2> trap : INT
+(eval):2> trap 'trap _p9k_trapint\;\ return\ 130 INT' EXIT
+(eval):3> local -a match reply mbegin mend
+(eval):4> local -i MBEGIN MEND OPTIND
+(eval):5> local MATCH REPLY OPTARG IFS=$' \t\n\C-@'
+(eval):5> [[ UTF-8 != (utf|UTF)(-|)8 ]]
+_p9k_worker_receive:3> [[ -z 12 ]]
+_p9k_worker_receive:6> ((  1 <= 1  ))
+_p9k_worker_receive:8> local buf resp
+_p9k_worker_receive:10> [[ -t 12 ]]
+_p9k_worker_receive:11> sysread -i 12 -t 0 'buf[$#buf+1]'
+_p9k_worker_receive:12> [[ $'\C-E' == *[^]# ]]
+_p9k_worker_receive:19> local -i reset max_reset
+_p9k_worker_receive:53> ((  max_reset == 2  ))
+_p9k_worker_receive:58> ((  max_reset  ))
+_p9k_worker_receive:59> return 0
+_p9k_worker_receive:61> ((  0  ))
+-zsh:1> trap '_p9k_trapint; return 130' INT
+_p9k_worker_receive:1> eval $'emulate -L zsh -o no_hist_expand -o extended_glob -o no_prompt_bang -o prompt_percent -o no_prompt_subst -o no_aliases -o no_bg_nice -o typeset_silent -o no_rematch_pcre\n  (( $+__p9k_trapped )) || { local -i __p9k_trapped; trap : INT; trap "trap ${(q)__p9k_trapint:--} INT" EXIT }\n  local -a match reply mbegin mend\n  local -i MBEGIN MEND OPTIND\n  local MATCH REPLY OPTARG IFS=$\' \\t\\n\\0\'; [[ $langinfo[CODESET] != (utf|UTF)(-|)8 ]] && _p9k_init_locale && { [[ -n $LC_ALL ]] && local LC_ALL=$__p9k_locale || local LC_CTYPE=$__p9k_locale }'
+(eval):1> emulate -L zsh -o no_hist_expand -o extended_glob -o no_prompt_bang -o prompt_percent -o no_prompt_subst -o no_aliases -o no_bg_nice -o typeset_silent -o no_rematch_pcre
+(eval):2> ((  0  ))
+(eval):2> local -i __p9k_trapped
+(eval):2> trap : INT
+(eval):2> trap 'trap _p9k_trapint\;\ return\ 130 INT' EXIT
+(eval):3> local -a match reply mbegin mend
+(eval):4> local -i MBEGIN MEND OPTIND
+(eval):5> local MATCH REPLY OPTARG IFS=$' \t\n\C-@'
+(eval):5> [[ UTF-8 != (utf|UTF)(-|)8 ]]
+_p9k_worker_receive:3> [[ -z 12 ]]
+_p9k_worker_receive:6> ((  1 <= 1  ))
+_p9k_worker_receive:8> local buf resp
+_p9k_worker_receive:10> [[ -t 12 ]]
+_p9k_worker_receive:11> sysread -i 12 -t 0 'buf[$#buf+1]'
+_p9k_worker_receive:12> [[ $'\C-E' == *[^]# ]]
+_p9k_worker_receive:19> local -i reset max_reset
+_p9k_worker_receive:53> ((  max_reset == 2  ))
+_p9k_worker_receive:58> ((  max_reset  ))
+_p9k_worker_receive:59> return 0
+_p9k_worker_receive:61> ((  0  ))
+-zsh:1> trap '_p9k_trapint; return 130' INT
ashtonian commented 8 months ago

its a feature of zsh + auto jump https://github.com/wting/autojump/issues/353#issuecomment-720013112