Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

recent path search not working for new paths #752

Open
ajilty opened this issue Sep 12, 2024 · 10 comments
Open

recent path search not working for new paths #752

ajilty opened this issue Sep 12, 2024 · 10 comments
Labels
bug Something isn't working

Comments

@ajilty
Copy link

ajilty commented Sep 12, 2024

Environment

% typeset -p1 VENDOR OSTYPE ZSH_PATCHLEVEL _autocomplete__funcfiletrace
typeset VENDOR=apple
typeset OSTYPE=darwin23.0
typeset ZSH_PATCHLEVEL=zsh-5.9-0-g73d3173
typeset -a _autocomplete__funcfiletrace=(
  /var/folders/j6/pjs4p22d77v7bvs6ds534c140000gp/T/tmp.gmBn94rnKi/zsh-autocomplete/zsh-autocomplete.plugin.zsh:4
  /var/folders/j6/pjs4p22d77v7bvs6ds534c140000gp/T/tmp.gmBn94rnKi/.zshrc:9
  zsh:0

% git -C ~autocomplete log --oneline -n1
762afac (grafted, HEAD -> main, tag: 24.09.04, origin/main, origin/HEAD) Add note to Readme about usage of `%`
  • Operating system: macOS 14.6.1 (23G93)
  • Terminal emulator: Terminal.app

Steps to reproduce

% cd $(mktemp -d)
% git clone --depth 1 -- https://github.com/marlonrichert/zsh-autocomplete.git
Cloning into 'zsh-autocomplete'...
remote: Enumerating objects: 53, done.
remote: Counting objects: 100% (53/53), done.
remote: Compressing objects: 100% (51/51), done.
remote: Total 53 (delta 0), reused 31 (delta 0), pack-reused 0 (from 0)
Receiving objects: 100% (53/53), 1.64 MiB | 13.75 MiB/s, done.

% > .zshrc <<EOF
setopt interactivecomments transientrprompt
PS1='%# '
PS2=
RPS2='%^'

source /var/folders/j6/pjs4p22d77v7bvs6ds534c140000gp/T/tmp.gmBn94rnKi/zsh-autocomplete/zsh-autocomplete.plugin.zsh

autoload -Uz chpwd_recent_dirs cdr
add-zsh-hook chpwd chpwd_recent_dirs

EOF
% env -i HOME=$PWD PATH=$PATH TERM=$TERM ${TERMINFO:+TERMINFO=$TERMINFO} zsh -d
% mkdir -p foo/bar/yummy  
% cd foo/bar 
% cd yummy
% cd ~
% cdr -l
1    /private/var/folders/j6/pjs4p22d77v7bvs6ds534c140000gp/T/tmp.gmBn94rnKi/foo/bar/yummy
2    /private/var/folders/j6/pjs4p22d77v7bvs6ds534c140000gp/T/tmp.gmBn94rnKi/foo/bar
3    /private/var/folders/j6/pjs4p22d77v7bvs6ds534c140000gp/T/tmp.gmBn94rnKi

% tail ~/.local/share/zsh/chpwd-recent-dirs
$'/var/folders/j6/pjs4p22d77v7bvs6ds534c140000gp/T/tmp.gmBn94rnKi'
$'/private/var/folders/j6/pjs4p22d77v7bvs6ds534c140000gp/T/tmp.gmBn94rnKi/foo/bar/yummy'
$'/private/var/folders/j6/pjs4p22d77v7bvs6ds534c140000gp/T/tmp.gmBn94rnKi/foo/bar'
$'/private/var/folders/j6/pjs4p22d77v7bvs6ds534c140000gp/T/tmp.gmBn94rnKi'

% +autocomplete:recent-directories
% echo $reply
/private/var/folders/j6/pjs4p22d77v7bvs6ds534c140000gp/T/tmp.gmBn94rnKi/foo/bar/yummy /private/var/folders/j6/pjs4p22d77v7bvs6ds534c140000gp/T/tmp.gmBn94rnKi/foo/bar /private/var/folders/j6/pjs4p22d77v7bvs6ds534c140000gp/T/tmp.gmBn94rnKi


# type `yummy`, hit tab, no suggestions
# up arrow does do the normal things
Contents of /var/folders/j6/pjs4p22d77v7bvs6ds534c140000gp/T/tmp.gmBn94rnKi/.local/state/zsh-autocomplete/log/2024-09-12.log (click to expand)
(empty)
@ajilty ajilty added the bug Something isn't working label Sep 12, 2024
@Rayzeq
Copy link

Rayzeq commented Sep 17, 2024

I have the same issue
I'm on Nixos with zsh-5.9-0-g73d3173.
Completions for recent directories works with 23.07.13 but not with 24.09.04.

@faileon
Copy link

faileon commented Sep 19, 2024

I guess the latest release changed the behaviour,

a8fdd21 Move recent paths completion to a keybinding. Resolves #640.

Is there a way to get the old one back? My autocompletions now no longer suggest the paths I use the most.
for example I could write
$ cd abc
and the autocomplete would suggest
~/Projects/company/abc
which was super neat

@faileon
Copy link

faileon commented Sep 26, 2024

@marlonrichert do you have any suggestions please?

@tommeier
Copy link

ah this is what broke recent-directories - I thought it was upgrading to sequoia - is downgrading the version in homebrew possible 🤔

@tommeier
Copy link

For those that miss autocomplete on ~/Projects/company/abc as much as me 😅

brew uninstall zsh-autocomplete
brew tap homebrew/core --force
brew extract --version=23.07.13 zsh-autocomplete $USER/local-zsh-autocomplete
brew install [email protected]
brew pin [email protected]

You'll then need to update your source, eg: source /path/to/zsh-autocomplete/zsh-autocomplete.plugin.zsh -> source /path/to/[email protected]/zsh-autocomplete.plugin.zsh (for me /path/to == brew --prefix) and then autocomplete recent-directories working as before 🎉

@faileon
Copy link

faileon commented Nov 4, 2024

Downgrading is surely a possible workaround. Hopefully it won't be the only solution and we can get this behavior back to the new versions :]

@runofthemill
Copy link

runofthemill commented Nov 23, 2024

trying to figure this out, and upon looking at #761 I figured trying setopt interactivecomments - and that seems to work!

looking at the issue template, setopt interactivecomments is part of the boilerplate, so seems like the new release changed requires interactivecomments to be set.

tl;dr - docs probably just need to be updated to note setopt interactivecomments must be set

@faileon
Copy link

faileon commented Nov 29, 2024

trying to figure this out, and upon looking at #761 I figured trying setopt interactivecomments - and that seems to work!

looking at the issue template, setopt interactivecomments is part of the boilerplate, so seems like the new release changed requires interactivecomments to be set.

tl;dr - docs probably just need to be updated to note setopt interactivecomments must be set

Hmm it seems to not work on my end. my .zshrc has the following:

setopt interactivecomments transientrprompt

but the recent paths still do not work. Really sad I can't get it working other way than downgrading, it was a great feature :(

@runofthemill
Copy link

@faileon you're totally right, and even now looking at the initial comment w/ the repro steps, OP indicated setopt interactivecomments was set. I must have been looking at some other behavior that wasn't working for me until I fixed that; apologies for the false hope 😿

@ttytm
Copy link

ttytm commented Dec 8, 2024

The recent path completion has been completely broken for a few months. I've been holding on to an earlier commit ever since. Cd into your zsh-autocomplete plugin/submodule path and

git checkout 2912c9788c08bbb86106ebd35dd94a376a2b2e99

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants