Skip to content
This repository has been archived by the owner on May 19, 2022. It is now read-only.

new env _FASD_ADD_MAX for max args to process in --add/--proc #129

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

unhammer
Copy link

In an example where '*' expanded to 17k elts, fasd used 10s before
giving the next bash prompt. This change cuts the list down to the
last _FASD_ADD_MAX arguments (defaults to 2000).

In an example where '*' expanded to 17k elts, fasd used 10s before
giving the next bash prompt. This change cuts the list down to the
last _FASD_ADD_MAX arguments (defaults to 2000).

# possibly too many elements:
if [ $# -gt $_FASD_ADD_MAX ]; then
shift $(( $# - _FASD_ADD_MAX ))
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW I found it surprising that this removed the first N excess arguments rather than the last N arguments. That said, I don't know a better way to do this in POSIX shell that isn't some big nasty loop. (I hit the same problem this PR tries to address. I'm now trying to migrate away from fasd to something else.)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
2 participants