Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Caching variables during completion



Hello,

my question first: Is it possible to set a variable only once during every command-line completion, i.e. only after hitting <Tab> for the first time and then keeping the contents for this specific command-line?

Explanation:
I'm trying to improve the completion for xrandr (mainly screen-scraping the available outputs and associated modes). However, my first try involved screen-scraping the output of `xrandr -q` every time a completion was made, which was slow. I then resorted to cache the available output/modes in a global variable. But this fails if a new output gets available.

Best,
Eike



Messages sorted by: Reverse Date, Date, Thread, Author