-
-
Notifications
You must be signed in to change notification settings - Fork 48
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
Command-line completion for Qubes-specific commands #7887
Comments
I can try to make it if no one wants. |
There is already an example of implementation (maybe outdated, that was made 7 years ago by @jgriffiths): It would be great to include something like that in the dom0 out of the box because otherwise no one will install or even know that it's possible. |
Thank you for the proposal and for volunteering to work on it! Let's see what @marmarek thinks of this idea when he has time to comment. |
I would be willing to answer any questions you have. |
I dont think it should take too long. |
@unman thanks for the link, but, as far as I understand, it's not what's needed from bash-completion. |
@unman or you meant that you would want to implement completion and it will not take you too long? Maybe I misunderstood. |
OK, now I'm starting to make an up to date and advanced bash completion for Qubes OS tools as I mentioned above.
Thank you @DemiMarie, I will contact you (probably by email) when I have questions to ask! |
I am halfway of making a script for amazing qubes completion. The completion is already working for 29 Qubes OS tools (it's more than a half of total amount of selected ones) and provides completion for everything:
A lot of work, including code cleaning, support of volume and pools completions, still has to be done. I also found a bunch of inconsistencies and minor errors in The completion also supports different ways of providing options:
I checked that all of those ways work in Qubes OS properly and the completion script provides options accordingly. It was hard. The list of Qubes OS tools that I decided to make advanced completion for:
If you think I'm missing something or want to provide any help - let me know. |
Nice!!!
That would be great!
Yes please!
I’d be willing to help review the code. A few questions:
|
I'm developing it in a qube, not in dom0, so I made simple stubs of qvm-ls, qvm-firewall, qvm-block. And it works instantly, so bash completion script by itself does not slow things down at all. But yes, actual
Not yet. I'm hoping to somehow pass completion to the |
performance hint: list vms with |
@marmarek yes, thank you, good point. I am already using By the way, another possible bug
Other issues I see:
There are many inconsistencies in tools. For example:
So, I see a room for improvement for all these tools and docs. |
Please make them!
Sure! |
On @qubes-dev mailing list or on github as a new enhancement issue, where more people sees and discuss it? Or both. |
Sounds like it would be better to start on qubes-devel, then create issue(s) only once concrete, actionable, and well-scoped tasks have been defined. It's not a matter of where more people see things. The issue tracker and each mailing list has its own rules and purpose. In particular, the issue tracker is not intended to serve as a discussion venue. |
Update on this - I created a wonderful hack that allows to autocomplete all the |
I've posted two proposals in qubes-devel, you probably saw. P.S. Frankly speaking, I consider qubes-devel to be nearly dead and inactive, so I expect no actual discussions there. |
@jamke, you are also welcome to post your proposals on the forum, if you like. Unlike qubes-users, qubes-devel is not automatically mirrored on the forum, so you would not be duplicating content that already exists on the forum. (Normally we discourage posting the same thing to multiple mailing lists, but posting to both the qubes-devel and the forum seems fine, as long as the content is appropriate to both venues.) |
Sorry for delay. |
Still keeping development, currently the project is on stage that I can almost share. I have a question about
It does not work inside |
@jamke I recommend not completing anything for |
Maybe I did not get you right. I am not talking about But when I copy the script from a development qube to By the way, completion of packages for commands like: |
@jamke: Sorry to hear you haven't received the feedback you wanted. I suppose everyone with the requisite skills has been too busy to volunteer. Since it looks like you're trying to contribute a package, I've updated this issue to conform to our package contribution guidelines. (It looks like you got some volunteers in your forum thread, but they said it'd be easier for them to work with a public git repo. My guess is the same might be true of the volunteers you're seeking here, so that's something to consider.) |
@andrewdavidwong I am going to open the repository and hope that it has no major flaws for people who decided to download and use it without reviews. |
I dont believe that you told me what repo was when soliciting review.
|
OK, now anybody can try it! https://github.com/jamke/qubes-completion Currently I would like somebody from the Team make some kind of code review or at least provide some feedback on code quality and information how well it works for you. |
Maybe I am not getting you right, but I sent invites on github to the project on May 9. I hoped that github provided information about name of the repo ( |
I changed the first post to reflect the fact that |
On Tue, Jun 27, 2023 at 08:52:47PM -0700, Jamke wrote:
> I dont believe that you told me what repo was when soliciting review.
Maybe I am not getting you right, but I sent invites on github to the project on May 9. I hoped that github provided information about name of the repo (`qubes-completion`) and the author/owner of repository, so it all will be obvious. Or you mean something else?
Dont have any record of that in email.
|
I do not know. github shows me that your invite was simply expired after a while. It is strange that you had no email notification for this event. Does not matter now, feel free to try it now. |
New release 1.0.2 of
|
I am reminding about this contribution. It works flawlessly, the Qubes OS experience really gets much better for advanced users with this clever completion. |
What's the status on this? I feel this would be one of the most important usability improvements to qubes that could be made (as in, I notice the lack of it every time I try to type a qubes command). |
@jamke I suggest making a GitHub PR to |
@DemiMarie well, I use it daily, and it's awesome, but I still don't know who among main devs actually tried my
@ddevz thank you for such kind words. |
I have not, because I don’t use contrib packages (except Whonix templates).
If you make a PR I can look at the code.
See above.
|
The problem you're addressing (if any)
The tab completion for
qvm-
,qubes-
and other Qubes OS specific commands is not working in Qubes OS.The solution you'd like
I made a really advanced bash completion scrcipt for Qubes OS commands, it is available here:
https://github.com/jamke/qubes-completion
Anybody can install it from Releases section of github.
Currently I would like somebody from the Team make some kind of code review or at least provide some feedback on code quality and information how well it works for you.
Feedback from average users will also be appreciated. So, feel free to try.
The proposal is to make it a part of the system out of the box (and add
bash-completion
that was missed probably by mistake (#7879).Some examples, more in README of the project:
qvm-ls --run
and<tab>
=>qvm-ls --running
qvm-ls --t
and<tab>
=>qvm-ls --tags
qvm-ls --tags
and<tab><tab>
=> shows the list of existing TAGs if possibleqvm-ls --
and<tab>
=> shows the list of possible arguments the usual bash-wayAnd support of the list of names of qubes (VMs) - would be great! Imagine you type in
qvm-clone
, you press<tab>
and get not the list of files in the current directory, but the list of VMs suitable for this place:qvm-clone
and<tab>
=> shows the list of existing VMsqvm-clone pe
and<tab>
=>qvm-clone personal
qvm-clone sys-
and<tab><tab>
=> shows the list of existing VMs that start withsys-
, because there is more than one.Problems
The only downside of such improvement - the completion information should be kept updated with the commands, the same way as documentation and
--help
output now.The value to a user, and who that user might be
It will significantly improve UX of Qubes OS users who uses terminal at least from time to time (almost everybody, I think).
The text was updated successfully, but these errors were encountered: