zsh-users / zsh-autosuggestions

Fish-like autosuggestions for zsh
MIT License
30.43k stars 1.85k forks source link

Plugin monopolizes `POSTDISPLAY` #661

Open Thesola10 opened 2 years ago

Thesola10 commented 2 years ago

Describe the bug

This plugin assumes that whatever is written to $POSTDISPLAY is an auto-suggestion, and the right arrow key action treats it as such.

To Reproduce

Steps to reproduce the behavior:

Write any function that writes to $POSTDISPLAY outside of zsh-autosuggestions, then press the right arrow key. zsh-autosuggestions fills it in as a suggestion despite not having generated it itself.

Expected behavior

Pressing the right arrow key should not insert the contents of $POSTDISPLAY onto the buffer

Screenshots

Desktop

Additional context

This interferes with the possibility of other plugins making use of $POSTDISPLAY. A fix would be to store the suggestion in a secondary variable as well, and use that variable in the right arrow key action.