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

file path auto-complete only works for the last argument #1062

Closed
2 of 12 tasks
houqp opened this issue Dec 26, 2024 · 2 comments · Fixed by #1063
Closed
2 of 12 tasks

file path auto-complete only works for the last argument #1062

houqp opened this issue Dec 26, 2024 · 2 comments · Fixed by #1063
Labels
bug Something isn't working darwin fund Fundable with polar.sh zsh

Comments

@houqp
Copy link

houqp commented Dec 26, 2024

Current Behavior

Given the following command: ls ./a ./b, auto-complete only works for the last ./b argument.

Expected Behavior

Given the following command: ls ./a ./b, auto-complete should work for both ./a and ./b.

Steps To Reproduce

  1. type ls ./a ./b
  2. move cursor to the end of ./a
  3. press tab to trigger auto-complete

Version

1.0.7

OS

  • Darwin
  • Linux
  • Termux
  • Windows

Shell

  • Bash
  • Elvish
  • Fish
  • Nushell
  • Oil
  • Powershell
  • Xonsh
  • Zsh

Anything else?

No response

Polar

Fund with Polar
@houqp houqp added bug Something isn't working fund Fundable with polar.sh labels Dec 26, 2024
@rsteube
Copy link
Member

rsteube commented Dec 26, 2024

Oof - $words includes the ones past cursor position so it tries to match ./b:

# zsh ❯ ls ./<TAB> ./b
2024/12/26 10:39:39.177375 zsh --------------------------------------------------------------------------------
2024/12/26 10:39:39.177424 zsh []string{"carapace", "ls", "zsh", "ls", "./", "./b"}
2024/12/26 10:39:39.177515 zsh traverse called for "ls" with args []string{"./", "./b"}
2024/12/26 10:39:39.177518 zsh executing PreRun for "ls" with args []string{"./", "./b"}
2024/12/26 10:39:39.177529 zsh arg "./" is a positional
2024/12/26 10:39:39.177568 zsh flag parsing is disabled for "ls"
2024/12/26 10:39:39.177570 zsh completing positionals and subcommands for arg "./b"
2024/12/26 10:39:39.177696 zsh executing "/home/rsteube/go/bin/carapace eza export eza ./ ./b"
2024/12/26 10:39:39.320002 zsh --------------------------------------------------------------------------------
2024/12/26 10:39:39.320070 zsh []string{"/home/rsteube/go/bin/carapace", "_carapace", "export", "eza", "./", "./b"}
2024/12/26 10:39:39.320232 zsh traverse called for "eza" with args []string{"./", "./b"}
2024/12/26 10:39:39.320241 zsh executing PreRun for "eza" with args []string{"./", "./b"}
2024/12/26 10:39:39.320263 zsh arg "./" is a positional
2024/12/26 10:39:39.320292 zsh parsing flags for "eza" with args []string{"./"}
2024/12/26 10:39:39.320298 zsh completing positionals and subcommands for arg "./b"
=(#b)(b)([ ]## -- *)=0=38;2;255;184;108=2:=(#b)(b)=0=38;2;255;184;108:=(#b)(-- *)=0=2filesb./b 

@houqp
Copy link
Author

houqp commented Dec 28, 2024

thanks for the quick fix, can confirm it's working for me as well 👍

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

Successfully merging a pull request may close this issue.

2 participants