-
Notifications
You must be signed in to change notification settings - Fork 154
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
Clipboard graceful handling #712
Conversation
This fixes the panic in wayland mode. 👍 |
It seems like adding the system_clipboard feature job to the CI caused the failure. I'm not sure why the Wayland dependency requires a nightly, not how to fix it. Is the extra CI step necessary? It would be great to land this because currently the latest Nushell built from main panics when launched without a window manager. |
Hey, I had the same problem in nushell. See this comment: nushell/nushell#11535 (comment) |
Please provide a big fat warning for the user in that case, I would be quite surprised if that happened silently to me |
No, I thought it was an oversight that the feature had been missed, but I think it might have been on purpose. There are several tests that use the clipboard, so when run in parallel they step on each other's toes and cause failures. The system clipboard is basically a big global mutable state. I think I'll remove the feature from the CI matrix. |
If the `system_clipboard` feature is enabled, but we failed to initialize the `SystemClipboard`, default to `LocalClipboard` instead of panicking.
e941078
to
40221bc
Compare
I do have a Also, I rebased my branch on |
Nushell prints this message every time when |
oh, does nushell recreate the whole reedline instance for every prompt? 🤔 Or did you mean every time a new shell is started? |
Yes, I believe that it does (you can check Instead of eprintln!, it would be better to be able to somehow query information about Reedline where you could check what is your current clipboard, for example. |
From what I can tell, it doesn't (the reedline instance seems to be created outside of the repl loop).
To be honest, I don't think I meant to commit that I think the only potentially confusing case would be if you are running |
An alternative might be to expose a |
There is Could you then remove the eprintln! so that we can merge it? We can then iterate on some better diagnostics, but let's have the unwrap fix merged first because it's urgent. |
@kubouch done. |
Awesome, thanks! |
I'm wondering if all this is because of our choice to use |
If by "all of this" you mean having to handle the absence of an available system clipboard and in particular on Linux CI, then I am pretty certain it would be the same with |
ya, sorry i wasn't more clear, "all of this" means the ci failures we're having due to the clipboard mess, like you said. thanks for the info. |
If the
system_clipboard
feature is enabled, gracefully handle the case where the system clipboard can't be accessed and default toLocalClipboard
in that case instead of panicking. This should help with running nu scripts in a docker container for instance.