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

Error with ls when aliased to eza #2601

Closed
2 of 12 tasks
mathomp4 opened this issue Nov 22, 2024 · 7 comments
Closed
2 of 12 tasks

Error with ls when aliased to eza #2601

mathomp4 opened this issue Nov 22, 2024 · 7 comments
Labels
bug Something isn't working darwin fund Fundable with polar.sh zsh

Comments

@mathomp4
Copy link

mathomp4 commented Nov 22, 2024

Current Behavior

I freely admit this is probably due to my setup, but I'm not sure what is happening and if I can fix it.

When I try and do tab completion with ls I get:

❯ ls
invalid argument "all" for "--color-scale" flag: strconv.ParseBool: parsing "all": invalid syntax

I can confirm carapace is doing this because if I comment out the:

export CARAPACE_BRIDGES='zsh,fish,bash,inshellisense' # optional
zstyle ':completion:*' format $'\e[2;37mCompleting %d\e[m'
zstyle ':completion:*:git:*' group-order 'main commands' 'alias commands' 'external commands'
source <(carapace _carapace)

bits of my .zshrc, it doesn't throw the error.

Now for the the exciting bits. My ls is not ls. My ls is:

COMMON_EZA_OPTIONS='--classify --icons --color=automatic --color-scale=all --header --group'
alias ls="eza $COMMON_EZA_OPTIONS --grid"

and if I turn that off, tab completion also works.

So, I guess my question is: Is there a way I can tell carapace that my ls is actually eza?

Expected Behavior

I guess have carapace know that my ls is actually eza.

Steps To Reproduce

This is how my system is setup:

  1. Set up carapace in zshrc with:
export CARAPACE_BRIDGES='zsh,fish,bash,inshellisense' # optional
zstyle ':completion:*' format $'\e[2;37mCompleting %d\e[m'
zstyle ':completion:*:git:*' group-order 'main commands' 'alias commands' 'external commands'
source <(carapace _carapace)
  1. Set EZA up with:
COMMON_EZA_OPTIONS='--classify --icons --color=automatic --color-scale=all --header --group'
alias ls="eza $COMMON_EZA_OPTIONS --grid"
  1. Try doing ls <tab>

Version

develop (brew says 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
@mathomp4 mathomp4 added bug Something isn't working fund Fundable with polar.sh labels Nov 22, 2024
@rsteube rsteube transferred this issue from carapace-sh/carapace Nov 22, 2024
@rsteube
Copy link
Member

rsteube commented Nov 22, 2024

Yes, I'm using eza as well:

  1. use carapace to create an alias instead of using your shell
# yaml-language-server: $schema=https://carapace.sh/schemas/command.json
name: ls
run: "[eza]"
  1. or bridge the completion
# yaml-language-server: $schema=https://carapace.sh/schemas/command.json
name: ls
parsing: disabled
completion:
  positionalany: ["$carapace.bridge.CarapaceBin([eza])"]

@rsteube
Copy link
Member

rsteube commented Nov 22, 2024

btw. this should also work (and be preferred as it let's carapace know the flags are already set):

yaml-language-server: $schema=https://carapace.sh/schemas/command.json
name: ls
run: "[eza, --classify, --icons, --color=automatic, --color-scale=all, --header, --group]"

It's just that it seems the --color-scale flag is currently wrong in carapace - gotta fix that.

same for 2.:

# yaml-language-server: $schema=https://carapace.sh/schemas/command.json
name: ls
parsing: disabled
completion:
  positionalany: ["$carapace.bridge.CarapaceBin([eza, --classify, --icons, --color=automatic, --color-scale=all, --header, --group])"]

@mathomp4
Copy link
Author

Sooooo...let's assume I'm quite new at carapace, which I am. Where do I make these changes?

Would it be in ~/.config/carapace/bridges.yaml? I mean, it seems to work (if I remove --color-scale=all from my options), but I want to be sure. 😄

@rsteube
Copy link
Member

rsteube commented Nov 22, 2024

~/.config/carapace/specs/ls.yaml but only on linux or if you use XDG_CONFIG_HOME.
Darwin has it under $HOME/Library/Application Support/....

See carapace --help to be sure: "Specs are loaded from [...]"

@rsteube
Copy link
Member

rsteube commented Dec 8, 2024

Assuming this is solved now, reopen if not.

@rsteube rsteube closed this as completed Dec 8, 2024
@mathomp4
Copy link
Author

mathomp4 commented Dec 9, 2024

@rsteube I can confirm that now that v1.1.0 is in brew, I upgraded and I can "restore" the --color-scale flag to my eza flags. Thanks!

@mathomp4
Copy link
Author

mathomp4 commented Dec 9, 2024

Or not. New issue incoming

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

No branches or pull requests

2 participants