olets / zsh-abbr

The zsh manager for auto-expanding abbreviations, inspired by fish. ~13,000 unique cloners as of May '24, 580+ Homebrew installs 6/23-6/24
https://zsh-abbr.olets.dev
Other
510 stars 18 forks source link

occasional unexpected loss of global abbreviations temp file #42

Closed olets closed 2 years ago

olets commented 3 years ago

Occasionally —possibly related to putting my computer to sleep and then waking it up again— I get a warning about a missing temp file. It's added to the rbuffer

For example:

# when the terminal loads
% _abbr_global_expansion:source:12: no such file or directory: /var/folders/xn/26nbvw6s6n30pfwf7rmz4tfw0000gn/T/zsh-abbr/global-user-abbreviations 

# when I then type `exec zsh`
% exec zsh_abbr_global_expansion:source:12: no such file or directory: /var/folders/xn/26nbvw6s6n30pfwf7rmz4tfw0000gn/T/zsh-abbr/global-user-abbreviations

# at this point, hitting ENTER to accept the line runs `exec zsh`, which resolves the problem
olets commented 2 years ago

Have also gotten this for regular abbreviations:

_abbr_cmd_expansion:source:12: no such file or directory: /var/folders/xn/26nbvw6s6n30pfwf7rmz4tfw0000gn/T/zsh-abbr/regular-user-abbreviations

Bet the temp dir is being removed by garbage collection. Should check to make sure the file exists. Something like in _abbr_load_user_abbreviations:setup.

olets commented 2 years ago

This is fixed for me in v4.5.0

Homebrew isn't noticing v4.5.0, working on figuring out why. But if you don't use Homebrew you should be able to grab the update now.

olets commented 2 years ago

Got that sorted out! This is now available to users who install with Homebrew.