-
-
Notifications
You must be signed in to change notification settings - Fork 55
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
Copy to clipboard #590
base: master
Are you sure you want to change the base?
Copy to clipboard #590
Conversation
This works only for the CLI frontend. I need to think about how to enable similar functionality for other frontends, ideally without reimplementing it from scratch — hopefully the only thing to be reimplemented would be the clipboard copying itself. Related to #584 |
Thank you very much. This does not seem to work for me on Linux (using a standard X server with i3). After typing
but the |
Hmm, how about now? (I don't have a linux box to test with.) Seems like linux does some weird stuff where dropping the clipboard clears its contents. Also it looks like when numbat-cli exits, the clipboard’s contents will be cleared for the same reason. Is it worth working around this? The arboard docs show how to do this, but it involves spawning a background process to host the clipboard, which seems like a lot of complexity for a small gain. |
Now I get an error message (same as in CI: https://github.com/sharkdp/numbat/actions/runs/11258512679/job/31305297678?pr=590#step:8:258), but if I fix that as suggested, I can compile it. When I try to copy something by typing
Interestingly, as soon as I copy something into the clipboard (anything), the process proceeds and prints
But nothing is in fact copied. |
Oh, so |
You mean the state you had before? (c7b4f89) No. It doesn't work. Even if numbat is still open.
I don't think so. A couple of applications have a similar behavior. It's slightly annoying, but I don't think it's a big problem for Numbat. |
How about now? |
Now it works — thank you! I will do a full review shortly. I will already note that I am a bit overwhelmed by the number of configuration options. I'm usually trying to keep the number of options very small, unless it's definitely necessary to add them. I'm not (yet) very strict about being backwards compatible, but once we are, we need to maintain all of those options. |
That's fair. I naively added (nearly) as much as was supported, with almost no editing. |
If it's not too much trouble, it would be great if we could remove them for now. Thank you. |
Actually very little trouble! I also renamed |
This is copy-to-clipboard functionality that was mentioned in #394. The
copy
copies the last result to the clipboard, formatted according to the user’s config or falling back to Numbat’s default display if no config, and prints that it has done so. In general I try to fall back to Numbat’s own defaults with user configuration where it makes sense. Here is the default config for this:Please bike-shed away on these configuration options — names, default values, anything extraneous or missing...
With the above config (generated by
numbat --generate-config
), you'd get this kind of output: