- Replace ZSH_AUTOSUGGEST_ALLOW_EMPTY_BUFFER with AI_MIN_INPUT
- Add ZSH_AUTOSUGGEST_AI_DEBUG environment variable
- Add debug logging function to diagnose failures
- Update history lines default from 20 to 5
- Update pwd history preference default to no
Min input provides clearer semantics: set to 0 for empty-buffer
suggestions or higher to require minimum input. Debug logging helps
diagnose missing suggestions by showing API request flow.
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Change endpoint configuration to use base URL pattern,
automatically appending /chat/completions path.
- Update default endpoint to base URL format
- Add automatic path construction in strategy
- Update README examples to use base URLs
- Update endpoint description to "base URL"
Follows OpenAI SDK standard pattern where users configure
base URL and library appends specific paths.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Enable AI suggestions on empty prompts with enhanced
environmental context.
- Update AI_MIN_INPUT default from 3 to 0
- Add ALLOW_EMPTY_BUFFER opt-in config variable
- Remove empty-buffer guards in modify, suggest, enable
- Add zle-line-init hook for prompt-time suggestions
- Enhance history gathering with PWD-aware priority
- Add env context for dir listing, git branch, status
- Implement dual prompts: predict vs complete modes
- Add prompt artifact stripping for $ and > prefixes
- Update README with empty buffer configuration
- Add tests for empty buffer and artifact stripping
Empty buffer suggestions require zsh 5.3+ and work best with
AI strategy, leveraging directory context, git state, and
command history to predict likely next actions.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Add new AI strategy that queries OpenAI-compatible LLM APIs
to generate intelligent command completions based on partial
input, working directory, and recent shell history.
- Add AI strategy implementation with JSON escaping
- Add context gathering with PWD prioritization
- Add response normalization for clean suggestions
- Add configuration defaults for AI settings
- Add comprehensive test suite with mocked responses
- Update README with setup guide and examples
Enables LLM-powered completions via ZSH_AUTOSUGGEST_AI_API_KEY
with silent failure and fallback to next strategy. Supports
OpenAI, Ollama, and custom endpoints. Requires curl and jq.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
The testing docker image has been split up. Instead of having one image
with all supported versions of zsh installed, we now have a separate
image for each supported zsh version.
We use GitHub Action matrices to run jobs in parallel for all of the
supported versions.
We no longer need to publish images to Docker Hub. The images are just
built by CI (or developers) as needed from the Dockerfile in the repo.
Set ZSH_AUTOSUGGEST_COMPLETION_IGNORE to a glob pattern to have the
completion suggestion strategy never make suggestions when the buffer
matches the pattern.
This can be helpful when some completion routines you have are
particularly expensive and you want to prevent them from running
automatically on every keystroke.
See GitHub issue #463.
Set ZSH_AUTOSUGGEST_HISTORY_IGNORE to a glob pattern to have the history
and match_prev_cmd suggestion strategies never make suggestions matching
that pattern.
For example, set to "cd *" to never suggest any `cd` commands from
history (see issues #340 and #425). Or set to "?(#c50,)" to never
suggest anything 50 characters or longer (see issue #429).
* Added a note for iTerm2 users under readme/configuration/highlight
style.
* Changed the link to the issue list under troubleshooting so that the
default filters (only open issues) are not applied.
Based on https://github.com/Valodim/zsh-capture-completion
`zpty -r` with a pattern seems to have some funky behavior on older
versions, giving unpredictable results
Don't use `-s` option to `zmodload`. It is not available in zsh versions
older than 5.3
If running in sync mode and a completion takes a long time, the user can
^C out of it. We need to use `always` in the strategy function or the
pty will not be destroyed in this case and the next time we go to create
it, it will fail, making the shell unusable.
User can have many different completion styles set that will modify what
they've already typed. These styles will result in suggestions that
don't match what the user has already typed. We try our best to unset
some of the more problematic ones, but add some code to fetch to
invalidate suggestions that don't match what the user's already typed.
See technique used in `fast-syntax-highlighting`:
- ca2e18bbc9
- http://www.zsh.org/mla/users/2018/msg00424.html
Also see http://www.zsh.org/mla/users/2018/msg00432.html
In async response handler:
- We only want to read data in case of POLLIN or POLLHUP. Not POLLNVAL
or select error.
- We always want to remove the handler, so it doesn't get called in an
infinite loop when error is nval or err.
There is an upstream bug that prevents ctrl-c from resetting the prompt
immediately after a suggestion has been fetched asynchronously. A patch
has been submitted, but a workaround for now is to add `command true`
after the exec.
See https://github.com/zsh-users/zsh-autosuggestions/issues/364
otherwise users are obliged to set the config values *after* sourcing
the plugin. They're not able to do it before. Also, re-sourcing the
plugin will reset the values to the defaults again.
See zimfw/zimfw#301
Fixes#335
This strategy relies on the history being exactly in the order in which
commands have been entered. Therefore, options like suppressing
duplicates or expiring duplicates first will lead to unexpected
suggestions.