carapace icon indicating copy to clipboard operation
carapace copied to clipboard

cache: add short lived cache

Open rsteube opened this issue 4 years ago • 0 comments

Unlike other shells bash does not enter a completion mode (caches the completion results) and thus invokes the same callback multiple times during <TAB> press. Add an implicit cache so that the same call within a short time will be returned directly to improve performance.

  • workdir must be the same
  • arguments/command line must be the same
  • just one cache file, overwrite if anything has changed (or last write time exceeded timeout)
  • try to get a lock on the file when writing and simply skip if not gotten it (though this should normally not happen)

rsteube avatar Dec 18 '20 11:12 rsteube