Sanitize /nix/store/* paths in saved .window_states[*].tabs[*].pane_tree.process.argv for vim/nvim/gvim#128
Open
andreystepanov wants to merge 1 commit into
Open
Conversation
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This change improves session saving by sanitizing the
executablepath and command-line arguments (argv) for nix-wrapped Vim/Neovim executables./nix/store/...executable paths with the corresponding basename (process_info.name) to avoid unstable paths across sessions.`--cmdand-c) followed by nix store paths fromprocess_info.argvto prevent pollution of shell history and improve session portability.vim,nvim,gvim).argvis always the sanitized executable name.This targeted fix addresses issues with restoring nix-wrapper influenced sessions, improving usability on NixOS setups without affecting other platforms or applications.
.window_states[*].tabs[*].pane_tree.processbefore:{ "argv": [ "/nix/store/jx332jllgyrqbnzi8svnk8xbygc9nbmp-neovim-unwrapped-0.11.5/bin/nvim", "--cmd", "lua vim.g.loaded_node_provider=0;vim.g.loaded_perl_provider=0;vim.g.loaded_python_provider=0;vim.g.python3_host_prog='/nix/store/252cmdyhmr8ai7qz266yrawgmx7nfz5h-neovim-0.11.5/bin/nvim-python3';vim.g.ruby_host_prog='/nix/store/252cmdyhmr8ai7qz266yrawgmx7nfz5h-neovim-0.11.5/bin/nvim-ruby'", "--cmd", "set packpath^=/nix/store/g0f4d93y9q79q84qq4g41lyfcw3i1z7h-vim-pack-dir", "--cmd", "set rtp^=/nix/store/g0f4d93y9q79q84qq4g41lyfcw3i1z7h-vim-pack-dir", "Cargo.toml" ], "cwd": "/home/user/project", "executable": "/nix/store/jx332jllgyrqbnzi8svnk8xbygc9nbmp-neovim-unwrapped-0.11.5/bin/nvim", "name": "nvim", "start_time": 6840603, "status": "Sleep" }.window_states[*].tabs[*].pane_tree.processafter:{ "argv": [ "nvim", "Cargo.toml" ], "cwd": "/home/user/project", "executable": "nvim", "name": "nvim", "start_time": 6840603, "status": "Sleep" }