fix: guard against missing remote_clipboard.lua in migration#6196
Open
sridhar-3009 wants to merge 2 commits into
Open
fix: guard against missing remote_clipboard.lua in migration#6196sridhar-3009 wants to merge 2 commits into
sridhar-3009 wants to merge 2 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the 1781587663.sh migration to avoid silently failing when the Neovim OSC52 clipboard provider source file is not present in the installed omarchy-nvim package, while still applying the tmux OSC 52 configuration change.
Tip
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.
Changes:
- Add a
[[ -f $provider_source ]]guard before copyingremote_clipboard.luainto the user’s Neovim config. - Print a clear diagnostic when the provider source file is missing so users know what was skipped.
- Keep the tmux
terminal-features ",*:clipboard"update unconditional (still gated only by “already present” detection).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Comment on lines
+11
to
+25
| mkdir -p "$(dirname "$nvim_provider")" | ||
| install -m 0644 "$provider_source" "$nvim_provider" | ||
|
|
||
| if [[ -f $nvim_options ]] && ! grep -qF 'config.remote_clipboard' "$nvim_options"; then | ||
| if tmp=$(mktemp); then | ||
| if ! { | ||
| printf '%s\n' 'require("config.remote_clipboard").setup()' | ||
| cat "$nvim_options" | ||
| } >"$tmp"; then | ||
| rm -f "$tmp" | ||
| elif ! mv "$tmp" "$nvim_options"; then | ||
| rm -f "$tmp" | ||
| fi | ||
| fi | ||
| fi |
Comment on lines
+1
to
+2
| echo "Enable secure remote Neovim clipboard support" | ||
|
|
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.
Migration
1781587663.shcallsinstall -m 0644 "$provider_source" "$nvim_provider"without first checking whether$provider_sourceexists. When theomarchy-nvimpackage hasn't yet shippedremote_clipboard.lua, theinstallcommand fails silently — no error is logged, but the Neovim clipboard provider is never set up.This adds an explicit
[[ -f $provider_source ]]guard and prints a diagnostic message when the file is absent so users know what was skipped and why. The tmux OSC 52 configuration is unaffected and still runs unconditionally.Closes #6143