resurrect.wezterm
resurrect.wezterm copied to clipboard
Errors during periodic save when window or pane includes glob character in title
I have the following configuration in place:
resurrect.periodic_save({
interval_seconds = 300,
save_workspaces = true,
save_windows = true,
})
I've noticed errors a few times when it saves a window where I'm running a command that includes a glob. As an example, I'd run vim resurrect/*.lua, and observed the following error when periodic_save triggered:
ERROR logging > lua: ...bsDscomsZsMLFlexersZsresurrectsDswezterm/plugin/init.lua:141: Encryption failed:zsh:1: no matches found: /home/matthew/.local/share/wezterm/plugins/httpssCssZssZsgithubsDscomsZsMLFlexersZsresurrectsDswezterm/state/window/vim resurrect+*.lua.json
- Should resurrect be escaping or converting globs to prevent this? (I think it should)
- Is there a way to work around it via, for instance, a
resurrect.save_state.startorresurrect.periodic_saveevent handler?
Thanks for the issue! You are 100% correct in that it should be escaped, and i even think it goes beyond just the glob, as the only things escaped in the file names are directory seperators. So filenames with characters like [ will also be a problem as they are treated as shell operators
I would like to solve this properly instead of just making a quick patch as I think it is a bigger issue, but given that I am currently busy at university then I don't know when I will be able to complete it.
However if this is bugging you, then you can use the branch with a temporary fix: temp_glob_fix by using git switch within the directory of the plugin :smile: