-
-
Notifications
You must be signed in to change notification settings - Fork 690
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
Serialisation struggles with shell strings #2925
Comments
yeah this is a big issue for me on nixos where lots of programs are wrapped. if i have something running like /home/nixos/.nix-profile/bin/nvim --cmd lua vim.g.node_host_prog='/nix/store/qmqip8ajqhzmf3gs68y8177nw7s56bd2-neovim-0.9.1/bin/nvim-node';vim.g.loaded_python_provider=0;vim.g.python3_host_prog='/nix/store/qmqip8ajqhzmf3gs68y8177nw7s56bd2-neovim-0.9.1/bin/nvim-python3';vim.g.ruby_host_prog='/nix/store/qmqip8ajqhzmf3gs68y8177nw7s56bd2-neovim-0.9 nvim here is just a shell script that sets a bunch of path variables and then executes exec -a "$0" "/nix/store/az6kgqpgs570xbk0c2c3pl0jx4ncgxqd-neovim-unwrapped-0.9.1/bin/nvim" --cmd "lua vim.g.node_host_prog='/nix/store/qmqip8ajqhzmf3gs68y8177nw7s56bd2-neovim-0.9.1/bin/nvim-node';vim.g.loaded_python_provider=0;vim.g.python3_host_prog='/nix/store/qmqip8ajqhzmf3gs68y8177nw7s56bd2-neovim-0.9.1/bin/nvim-python3';vim.g.ruby_host_prog='/nix/store/qmqip8ajqhzmf3gs68y8177nw7s56bd2-neovim-0.9.1/bin/nvim-ruby'" "$@" but due to the missing quotation marks and the missing positional argument i can't enter my nvim session. |
So this is why all my nix installed packages aren't resurrecting. Hope this can be solved, for me the resurrection just doesn't do it right now. I have to drop the shells because the resurrection command it's not what I want. |
Has anyone has found a workaround to this(nixos) for now? on tmux-resurrect I could setup a resurrect-hook-post-save-all to manually fix the issues. |
@imsnif Hey, sorry to bother you, I am trying to have a look at this and trying to see if the issue is with the serialization and particularly splitting the args on whitespace. I am wondering where I should be looking. I am currently in looking over here: zellij/zellij-utils/src/session_serialization.rs Lines 219 to 227 in 462239b
I am not a rust developer 😓 so trying my best to follow the code. Could you provide a bit of guidance if I am looking in the right place 🙏 . Thank you very much, I appreciate you are very busy! |
I wonder if I can resurrect the sessions with pane layout without rerun previous command? Can it make an options so I don't have to go to each pane and press |
Same issue here |
Following. Same here. |
These have been (mostly) fixed by #3636 (still unreleased but just merged to I say "mostly" because what the PR fixed is the serialization part, the session-serialization still relies on the system's perspective of the running process (at the time of writing gleaned through To give an example, in the original report, the command: Other examples might be various applications that run inside some sort of wrapper (eg. nix, electron, node, various java runtimes, etc.) While there are ways around this, they are often particular to the task at hand. Maintaining a list of ways this information can be found and linking it to the particular command type is out of scope for Zellij core. In the future, I hope to add to the plugin API to allow plugins to optionally add other methods of doing this. For now, I feel this solution is good for the vast majority of cases. *I hope readers will forgive me this simplification |
I'm using neovim-unwrapped. It comes with an ELF executable as the entry point, unlike the bash script in neovim, so there's no issue with missing double quotes. |
Hey there!
I love the new resurrection feature. Unfortunately I managed to find a bug in the serialisation. When resurrection a session that includes pipes and strings, the session runs a command with the wrong arguments.
For example, running
in a shell, quitting the session and resurrecting it produces unexpected behaviour. In this example, grep returns
Basic information
zellij --version
:stty size
:uname -av
orver
(Windows):Other software
dmesg --version
:grep --version
:zsh --version
:Further information
How to reproduce:
Produces:
Notably, the pane is also called
grep --color=auto --color=never -P (oom|Out of memory)
This appears to be because the pipe and
'
are being incorrectly serialised:% cat ~/.cache/zellij/0.39.0/session_info/serial-bug/session-layout.kdl
Note how the command for the pane is
grep
and the string got mangled:If I replace this with
grep works without errors, but is missing the dmesg input. I don't know to what extent this is fixeable but figured I should still report it.
Thank you for your time!
The text was updated successfully, but these errors were encountered: