Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

possible json sanitize bug on workspace switching #98

Open
strobe opened this issue Jan 30, 2025 · 4 comments
Open

possible json sanitize bug on workspace switching #98

strobe opened this issue Jan 30, 2025 · 4 comments
Labels
bug Something isn't working

Comments

@strobe
Copy link

strobe commented Jan 30, 2025

sometimes after while, workspace switching stop working and it starting trowing errors like this:

13:56:00.747 ERROR wezterm_gui::overlay::selector > while processing user-defined-29 event: runtime error: ...xersZsresurrectsDswezterm/plugin/resurrect/pane_tree.lua:80: attempt to index a nil value (field 'pane')
stack traceback:
        ...xersZsresurrectsDswezterm/plugin/resurrect/pane_tree.lua:80: in upvalue 'insert_panes'
        ...xersZsresurrectsDswezterm/plugin/resurrect/pane_tree.lua:135: in upvalue 'insert_panes'
        ...xersZsresurrectsDswezterm/plugin/resurrect/pane_tree.lua:140: in function <...xersZsresurrectsDswezterm/plugin/resurrect/pane_tree.lua:75>
        (...tail calls...)
        ...xersZsresurrectsDswezterm/plugin/resurrect/tab_state.lua:74: in function 'resurrect.tab_state.get_tab_state'
        ...sZsresurrectsDswezterm/plugin/resurrect/window_state.lua:17: in function 'resurrect.window_state.get_window_state'
        ...resurrectsDswezterm/plugin/resurrect/workspace_state.lua:50: in function 'resurrect.workspace_state.get_workspace_state'
        [string "/home/evgeniy/.wezterm.lua"]:191: in function <[string "/home/evgeniy/.wezterm.lua"]:189>
stack traceback:
        [C]: in local 'poll'
        [string "?"]:4: in function 'wezterm.emit'
        ...xersZssmart_workspace_switchersDswezterm/plugin/init.lua:174: in function <...xersZssmart_workspace_switchersDswezterm/plugin/init.lua:172>

where .wezterm.lua"]:189 in this case:

189 wezterm.on("smart_workspace_switcher.workspace_switcher.selected", function(window, path, label)
190  local workspace_state = resurrect.workspace_state
191  resurrect.save_state(workspace_state.get_workspace_state())
192 end)

Ans seem if just kill wezterm and resurrect workspaces then it continue to work normally.

@MLFlexer
Copy link
Owner

Are you using encryption?
And what platform are you on? Windows?

I might have encountered this before, and based on the answers to the above it might be caused by the state being large. You can limit the number of lines saved per pane with set_max_nlines. This should fix it if you can set it to something reasonable like 1k

@strobe
Copy link
Author

strobe commented Jan 30, 2025

no encryption.
NixOS 24.11

I will try set_max_nlines.

@MLFlexer
Copy link
Owner

MLFlexer commented Feb 1, 2025

no encryption. NixOS 24.11

I will try set_max_nlines.

Hmm, strange then it might not be related

If it happens again, then it would be very helpful if you could send me the state file. It is stored in ~/.local/share/wezterm/plugins/httpssCssZssZsgithubsDscomsZsMLFlexersZsresurrectsDswezterm/state/workspace 😄

@MLFlexer MLFlexer added the bug Something isn't working label Feb 1, 2025
@strobe
Copy link
Author

strobe commented Feb 1, 2025

ok, I will send it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants