MLFlexer / resurrect.wezterm

A plugin to restore windows, tabs and panes for Wezterm inspired by tmux-resurrect
MIT License
65 stars 2 forks source link

Errors during periodic save when window or pane includes glob character in title #68

Open weierophinney opened 22 hours ago

weierophinney commented 22 hours ago

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
MLFlexer commented 10 hours ago

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: