QubesOS / qubes-issues

The Qubes OS Project issue tracker
https://www.qubes-os.org/doc/issue-tracking/
534 stars 46 forks source link

`bash-completion` package missing in dom0 #7879

Open jamke opened 1 year ago

jamke commented 1 year ago

Qubes OS release

R4.1.1

The problem you're addressing (if any)

Currently dom0 has no proper tab completion in many cases. Even sudo qubes-dom0-update command requires to be typed in manually and completely. The same situation is with fedora templates.

The solution you'd like

Install bash-completion package in dom0 by default, and in fedora-* templates too (at least not-minimal ones).

The value to a user, and who that user might be

It will make new users experience much smoother.

unman commented 1 year ago

I have this. (4.0 upgrades and 4.1 installs) It's included on the installer iso

jamke commented 1 year ago

@unman I had to install it manually in dom0 in 4.1.1 if I'm not mistaken. Can somebody confirm it?

I think bash-completion is a must-have thing like man.

andrewdavidwong commented 1 year ago

I had to install it manually in dom0 in 4.1.1 if I'm not mistaken. Can somebody confirm it?

Tab completion in dom0 works for me on a clean 4.1.1 installation, and I never manually installed bash-completion or anything like that.


Closing as an "unsuitable proposal" (the proposed action is unsuitable, e.g., because it rests on a false assumption or misunderstanding, such as a proposed enhancement designed to fix something that is not really a problem in the first place). If anyone believes this is a mistake, please leave a comment, and we'll be happy to take another look. Thank you.

jamke commented 1 year ago

Sorry for it, I'm probably wrong with this proposal.

jamke commented 1 year ago

Oh, I just reinstalled clean R4.1.1 and I was not wrong after all, guys! Even after update of Qubes OS R4.1.1 to the the most up-to-date state, the bash completion is not working properly in Qubes OS.

@unman and @andrewdavidwong please check this for yourself: 1) Open terminal in dom0 2) Enter sudo qub 3) Press tab once, twice or any other number of times.

What happens for you? For me - nothing happens, tab completion does not work in bash terminal in this obvious and super-common situation.

Now do sudo qubes-dom0-update bash-completion in dom0 to install it, reopen terminal (important) and try this sequence again. Now it works properly and nicely, doesn't it?


@andrewdavidwong I'm gladly asking to re-open this enhancement proposal and add this tiny (259k download) bash-completion package to dom0 of Qubes OS for future releases and current updates.

P. S. Maybe, it's a good idea to add it to fedora templates too, at least usual big one, because bash-completion is a package one should install firstly in any template to use terminal conveniently.

andrewdavidwong commented 1 year ago

please check this for yourself:

  1. Open terminal in dom0
  2. Enter sudo qub
  3. Press tab once, twice or any other number of times.

Tab completion works for me without sudo. With sudo, it doesn't work.

jamke commented 1 year ago

0) Thank you for reopening the proposal.

1) Running qubes-dom0-update makes no sense without sudo (or sudo -i which is probably not advised). So, even entering commands like qubes-* is currently a pain for some people who are used to properly working tab completion.

2) The current title is misleading. It's not only about sudo. In many other scenarios tab completion is not working properly without bash-completion package. It's just you are not used to it functioning, but when you are - you notice all the time that Qubes OS dom0 and all templates have only half-working tab completion.

Tab completion works for me without sudo. With sudo, it doesn't work.

And after you installed small package bash-completion did it start to work for you? I have this issue since forever in Qubes OS, so every time I install it as one of the first packages.

andrewdavidwong commented 1 year ago

Thank you for reopening the proposal.

It seems like it could be a bug, so I reclassified this as a bug report (at least until diagnosed otherwise).

The current title is misleading. It's not only about sudo. In many other scenarios tab completion is not working properly without bash-completion package.

Can you provide any reproducible examples?

And after you installed small package bash-completion did it start to work for you?

I don't have a test machine to test this myself, sorry.

jamke commented 1 year ago

Can you provide any reproducible examples?

Yes, a lot of those. E.g. dd sta followed by <tab> makes nothing in both dom0 and any of fedora-* templates. With proper bash-completion it changes to dd status=. Even more, another <tab> will provide all possible values for status= arg: none noxfer progress, while in Qubes OS this also does not work.

The same situation is with almost any common command called from bash in Qubes OS. Package bash-completion is a real must-have one for people who use terminal excessively, and I think Qubes OS users do.

The long list of commands and tools that get proper tab completion in bash is provided here: https://github.com/scop/bash-completion/tree/master/completions

jamke commented 1 year ago

I changed the first message a bit to reflect that tab completion is not entirely absent in dom0. So, I would consider it not a bug but an enhancement or default packaging improvement proposal.

andrewdavidwong commented 1 year ago

default packaging improvement proposal

Please note:

https://www.qubes-os.org/faq/#could-you-please-make-my-preference-the-default

and

https://www.qubes-os.org/faq/#what-is-qubes-attitude-toward-changing-guest-distros

A key question: Is this package also missing from upstream default Fedora installations? If so, why? Maybe the enhancement request should be directed at them instead. Then we could simply inherit the enhancement without a Qubes-specific patch.

So far, it doesn't really sound like this is a Qubes-specific issue.

jamke commented 1 year ago

So far, it doesn't really sound like this is a Qubes-specific issue.

I still think this it's not an real issue nor a bug, please remove this tag. It's an enhancement request.


I have no real Fedora installation to check. But bash completion works properly in *ubuntu distros (except minimal) and in Debian. It also works in Qubes OS Debian-based-templates, I just checked. But it does not work properly in Qubes OS in Fedora-based-templates and most importantly - not in dom0.

Please note, that Fedora is a more GUI-oriented and user-friendly OS than Qubes OS due to obvious reasons. Quite possible they simply do not care much about terminal-users because the approach of the distro is different, I don't know.

The Qubes OS, on the other hand, requires users to use terminal instead of GUI way more often, some things are only possible using terminal and bash. Documentation in many cases also provide only bash/terminal solutions.

That being said, I see your point and it makes sense.

Maybe I should keep installing this package further in each dom0 installation and template creation. Though, I'm a bit worried that Qubes OS users do not understand that terminal in dom0 is not working as good as in other distros because they do not even know that such package exists. I see that even experienced QubesOS users do not know how proper bash completion can work on other systems. To my opinion when one installs bash-completion in theirs Qubes OS, they keep it forever. :)

andrewdavidwong commented 1 year ago

I still think this it's not an real issue nor a bug, please remove this tag. It's an enhancement request.

I still haven't seen you offer any actual reasoning to back up this opinion, but since I can see it going either way, I've changed the labels back.

(FWIW, a non-Qubes-specific enhancement request also wouldn't belong in this issue tracker.)

Please note, that Fedora is a more GUI-oriented and user-friendly OS than Qubes OS due to obvious reasons. Quite possible they simply do not care much about terminal-users because the approach of the distro is different, I don't know.

The Qubes OS, on the other hand, requires users to use terminal instead of GUI way more often, some things are only possible using terminal and bash. Documentation in many cases also provide only bash/terminal solutions.

I can see this potentially being a reason to include the package by default in Qubes even if it's not included by default in Fedora, but it still seems weird to me that Fedora wouldn't include it by default without some reason, and I'd be interested in understanding that reason.

Maybe I should keep installing this package further in each dom0 installation and template creation. Though, I'm a bit worried that Qubes OS users do not understand that terminal in dom0 is not working as good as in other distros because they do not even know that such package exists. I see that even experienced QubesOS users do not know how proper bash completion can work on other systems. To my opinion when one installs bash-completion in theirs Qubes OS, they keep it forever. :)

Sure, I see where you're coming from. This is at the heart of making one's preference the default. In some cases, it might really be true that everyone would be better off if one person's preference became the default, and maybe this is one of those rare cases, but since the person who has that preference might be a bit biased, let's just let the devs decide.

marmarek commented 1 year ago

If my reading of the comps file is correct, standard Fedora does include bash-completion by default.

andrewdavidwong commented 1 year ago

If my reading of the comps file is correct, standard Fedora does include bash-completion by default.

Strange, so does Qubes take it out for some reason?

marmarek commented 1 year ago

Looks like a bug.

jamke commented 1 year ago

I still haven't seen you offer any actual reasoning to back up this opinion, but since I can see it going either way, I've changed the labels back.

Well, my logic is that the package is optional (nothing depends on it really) and dom0 is considered to be the most important VM, thus it's advised to have only necessary packages for work there (but more than in fedora-minimal, though).

If Fedora really has bash-completion by default and the removal of it was not intentional than I agree to consider it as a packaging bug.

andrewdavidwong commented 1 year ago

Well, my logic is that the package is optional (nothing depends on it really) and dom0 is considered to be the most important VM, thus it's advised to have only necessary packages for work there (but more than in fedora-minimal, though).

These considerations are not really relevant to whether it's a bug, though. A bug is just any problem or defect resulting in unintended behavior in something that exists. You can have a bug in something that's optional, and you can even have a bug where fixing the bug would reduce security. That might lead you decide not to fix the bug (R: won't fix) or to redesign things in such a way as to avoid the bug without sacrificing security, but the bug is still a bug.

unman commented 1 year ago

It is included in stock Fedora. I do not think it has ever been included in Qubes.

I have always assumed this was a deliberate policy to make it more difficult to work in dom0. As more has moved to GUI tools, this continues to make sense as a policy. (Make it easy to do the right thing;Don't make it easy to do the wrong thing.)

If the aim is only to have sudo qubes-dom0-update make that an alias. There are, as already pointed out, existing completions for qvm tools in dom0.

andrewdavidwong commented 1 year ago

I have always assumed this was a deliberate policy to make it more difficult to work in dom0.

If it's a deliberate decision not to include this package (and we're still sticking with that decision), then this issue can be closed as "not a bug." However, @marmarek commented above, "Looks like a bug." So, I don't know.

jamke commented 1 year ago

It's not intentional, because this useful package would not be removed from other fedora templates, including full one with several GiB of really less useful stuff. So, I am sure, @unman 's assumption is not right, it was not done on purpose.

unman commented 1 year ago

My assumptions are often not right. None the less, I think it is the right Thing(TM)

mooreye commented 6 months ago

Still missing in R4.2

jamke commented 6 months ago

Still missing in R4.2

@mooreye thanks for update. I cannot explain why this happens with Qubes OS. The situation repeats not-working keyboard layout switching. I think that the packaging and Qubes OS development approach in whole is fundamentally broken in some way. Maybe, it's time priorities, roadmaps, approaches should be reconsidered.

I cannot imagine any major GNU/Linux that would be "forgetting" to add bash completion for so many versions and years. Especially, after being notified of lacking bash completion quite long time ago. And it happens with the system that targets more advanced uses who can use terminal more often.

ben-grande commented 6 months ago

@jamke

Please understand that your issues are your priority but they may not be others priority, especially for such a small team that faces many other users requests asking for their issue to be the one to be fixed first.

Despite your derogatory remarks, I am providing some information below to elucidate the problem because it interests me, but I do not agree with your approach.


Dom0 does not have bash-completion installed by default:

[user@dom0 ~]$ dnf repoquery --userinstalled bash-completion
bash-completion-1:2.11-8.fc37.noarch

Default Fedora 39 template does not have bash-completion installed by default:

[user@fedora-39 ~]$ dnf list bash-completion
Available Packages
bash-completion.noarch                   1:2.11-12.fc39                   fedora
[user@fedora-39 ~]$ dnf list --installed bash-completion
Error: No matching Packages to list

The fedora 37 comps lists it in the standard group, but other packages in that group are not installed also, such as cifs-utils. Same thing for fedora 39 comps, not all tools in that list are installed. The package bash-completion may be found in other groups also: python-classroom, workstation-product.

The group standard is not installed in fedora-39:

[user@fedora-39 ~]$ dnf group list --hidden
Last metadata expiration check: 0:34:59 ago on Mon Mar 18 10:40:47 2024.
Available Environment Groups:
   ...
Installed Groups:
   GNOME
   Hardware Support
   Multimedia
   Common NetworkManager Submodules
   Printing Support
Available Groups:
   ...
   Standard
   ...

And I can't even find the standard group in dom0:

[user@dom0 ~]$ sudo qubes-dom0-update --action=group list --hidden
Using qube as UpdateVM to download updates for Dom0; this may take some time...
Unable to detect release version (use '--releasever' to specify release version)
Available Environment Groups:
   Qubes OS with Xfce
Available Groups:
   Anaconda tools
   Base
   X Window System
   Core
   Fonts
   Hardware Support
   KDE
   Sound basic support
   Xfce
   Extra plugins for the Xfce panel
   Multimedia support for Xfce
   Qubes Environment
   Qubes UI (Audio/Gui)
   Fedora 37 template
   Debian 11 (bullseye) template
   Whonix
Error: No group data available for configured repositories.

I have no idea why Fedora 37 and Debian 11 template versions are old on that list, but unrelated to this issue.

Group standard can't be found in dom0:

$ sudo qubes-dom0-update --action=groupinfo standard
Using qube as UpdateVM to download updates for Dom0; this may take some time...
Unable to detect release version (use '--releasever' to specify release version)
Fedora 37 - x86_64
Fedora 37 - x86_64 - Updates
Qubes Host Repository (updates)
Warning: Group standard does not exist.
Qubes OS Repository for Dom0
Qubes OS Repository for Dom0
Warning: Group standard does not exist.

It is also not installed in debian-12-xfce:

user@debian-12-xfce:~$ apt list --installed bash-completion
Listing... Done

No group or package installed in dom0 or the fedora or the debian templates depends on bash-completion, that is why it is never installed, as it is a usability feature, a recommends, not a depends classification in the package definition (RPM .spec or debian/control).

It may be a bug that the standard group is not available in Dom0 and not installed in the fedora templates, it may not be a bug also. Whoever wants to solve this issue needs to see if the group was ever installed explicitly by the default qubes installation before and what happened that it is not being installed anymore, if this was ever the case, it is a bug.

If this was not the case, this is an enhancement request and @andrewdavidwong comment about "making my preference the default" applies.


@jamke said:

It's not intentional, because this useful package would not be removed from other fedora templates, including full one with several GiB of really less useful stuff. So, I am sure, @unman 's assumption is not right, it was not done on purpose.

Removing it was never done, it was just never added explicitly, it was pulled as a dependency by a group or package.

jamke commented 6 months ago

@ben-grande I really appreciate your effort of investigating. I hope it will help to finally solve this issue. You can call it group-packaging problem if you want.

But my point is that we should look the OS from the users perspective first. Because user base is the most valuable part that tests, supports, reports, forms community and spreads information and interest for the OS. From this perspective, the actual problem is that Qubes OS is the only GNU/Linux-like OS I know that DOES NOT HAVE bash completions, not in dom0, nor in the main template for 10+ years. All GNU/Linux distros have it since dawn, including Fedora.

Why do you think that having bash completion is MY priority when in fact I can solve this issue for myself with 2 commands in the terminal? Nor is it "my defaults" as I explained above, it's EVERYBODY's defaults on every OS out there. Please consider that before making such assumptions about me as they sound a bit offensive to me.

All I want is to make Qubes OS better and more pleasant to use for users. That is why I made several code contributions and forum activity. And I really think that the development process of my favorite (and the only) OS should be significantly adjusted to avoid such situations when users suffer without basic things like layout switching for 1-2 major OS updates, or does not have bash completion for 10+ years. I hope such adjustments will eventually take place, as I said to @mooreye. Because otherwise my favorite OS may not go far, loose user base, user interest, financial support and die, leaving me without it. It is my personal priority: to avoid all that by making Qubes OS better for other users.

jamke commented 6 months ago

@andrewdavidwong I am sorry if my frustration made you make the priority higher. I was not intending to do so, as I do not consider it a major issue. My frustration is more about this issue being: 1. obvious and 2. easy to fix (seemingly), that's all. I am really OK for lowering priority back.

unman commented 6 months ago

I completely agree that we should look at the OS from the users perspective, but we should do it through the lens of QubesOS. There's a long standing move away from use of the terminal in Qubes, and repeatedly this is reserved for "advanced users".

It's simply not true that bash completion is EVERBODY's default in Qubes. For most users it's profoundly unimportant. For people who want completion, it's just "huh, that's weird" and, as jamke says, 2 commands in the terminal. Most users dont want it and dont miss it (or vice versa).

Of course, if the package is included, I wont take steps to remove it. (I have done this with other configuration changes.) But for almost all of my users, it will do nothing to make Qubes "better and more pleasant"

jamke commented 6 months ago

Removing it was never done, it was just never added explicitly, it was pulled as a dependency by a group or package.

I have never meant that the package was removed from Qubes OS. I said removed from Fedora, meaning being missed during migration of the Fedora OS to the template and dom0. I also said that @unman 's assumption that the package was not migrated to the dom0/templates from Fedora intentionally is not right. And it happens to be the case, the package was missed by mistake, and even exists in Debian templates.

It's simply not true that bash completion is EVERBODY's default in Qubes

No, I said: it is default for everybody on any OS out there. Because every GNU/Linux user has it, it presents by default everywhere, including Fedora, Ubuntu, Debian. So, it is default for everybody (except unlucky Qubes OS users).

But for almost all of my users, it will do nothing to make Qubes "better and more pleasant" - it will make no difference at all.

Well, maybe for your users it won't. But for many Qubes OS users who type in commands in terminal (in dom0 or any other qube), any commands, like 7z, dd, cmake, cp, bzip, chown, chmod and about 1000 more, it can make a huge difference in comfort. At the moment users simply have worse experience because even Qubes OS users do not know how bash completion should work, and when it works properly and when it doesn't (check out the first posts in this ticket for examples), and how to fix it when it does not work.

unman commented 6 months ago

For whatever reason you ignored my comment about use of the terminal in Qubes. It's just not high priority imo, or any priority at all. Views differ.

jamke commented 6 months ago

There's a long standing move away from use of the terminal in Qubes, and repeatedly this is reserved for "advanced users".

Yep, and on forum you and other users give recommendations and answers almost exclusively with commands to type in the terminal. Community guides and wiki consist of almost 100% of pages describing what terminal commands to run.

I do know if we should discuss some long move, and deprive Qubes OS of proper terminal experience whiles terminal commands are written all over both official and community information sources.

jamke commented 6 months ago

It's just not high priority imo, or any priority at all.

As I said, I also think it is not high priority. But it is simple a thing that is 1. broken, 2. seems to be easy to fix, and 3. had to be fixed faster than the whole Qubes OS lifetime (since R1.0 beta or something).

Who knows, maybe we spent 100 times more time writing messages in this very ticket than it will take to actually fix this packaging bug. :)

unman commented 6 months ago

I've been trying to persuade you that this is not a bug and not of any priority. Unsuccessfully. It's not worth spending time on, so I wont spend any further time here.

jamke commented 6 months ago

marmarek said the missing bash completion was not intentional:

Looks like a bug.

neoniobium commented 6 months ago

Since installing software to dom0 is at least somewhat discouraged the question if or if not bash-completion should be installed by default manifests in a different form than in any other distribution. A user might be hesitant to install it without an explicit remark that doing so is likely being a save action to take and therefor ends up with a worsened user experience.

renehoj commented 6 months ago

dom0 is not just a Linux shell, it's the adminVM.

The argument that dom0 needs to have pre-installed shell enhancement, to sweeten the experience for users who don't know how to do the installation themselves, just seems wrong on multiple levels.

If you don't know how to use dom0 you shouldn't be using it, at the very least you shouldn't be using it in any capacity that require you to have bash-completion installed. And if you know how to use dom0, you are more than capable of installing bash-completion without any help.

neoniobium commented 6 months ago

The point I assumed to make was not about a user's the capability of just installing software in dom0 but the unclear security impact of installing any particular tool (bash-completion) in dom0 which an user might assume to be negative.

slayoo commented 6 months ago

FWIW, given that bash-completion sometimes does much more than one would expect: network connections, recursive directory scans, shell trickery (see, e.g., https://news.ycombinator.com/item?id=21174819, https://discussion.fedoraproject.org/t/why-bash-auto-completion-is-so-slow-with-dnf/88944) and that it does have security vulnerabilities (https://security-tracker.debian.org/tracker/CVE-2018-7738, https://blog.grimm-co.com/2020/05/malicious-command-execution-via-bash.html), perhaps keeping it an option, or at least defaulting to just a small cherry-picked relevant subset of completion scripts would make sense? (plus the qubes-completion)

Perhaps what ships with util-linux could be such a relevant subset (https://git.kernel.org/pub/scm/utils/util-linux/util-linux.git/tree/bash-completion) vs. https://github.com/scop/bash-completion (this one is referred from https://packages.fedoraproject.org/pkgs/bash-completion/bash-completion/).

jamke commented 6 months ago

FWIW, given that bash-completion sometimes does much more than one would expect: network connections, recursive directory scans, shell trickery

Completions do what user wants. If they want something like to complete the next directory name of network path, the network request will be made (it will not result in anything bad in case of offline dom0, though). If user want to complete qube name (VM name) for something like qvm-clone than qvm-ls will be called and if this tool is slow, than it will block shell for a second or something. Why should the completion be blamed in this such cases? Do not press tab button for invoking completion if it is not needed, or make commands like qvm-ls work faster, there is no better solution. By the way, qvm-ls was improved significantly by speed, so it became great for using it as a qubes completion source.

Also dom0 is full of software, that is way less useful than basic bash completion.

you are more than capable of installing bash-completion without any help.

@renehoj how should advanced users, e.g. like @unman, @andrewdavidwong, or myself, understand that they need to install that particular package? The DO NOT KNOW, you can check the first replies in this very ticket and find out, that even advanced users do not know how exactly completion works and what need to be installed to make it work properly. Where would the other terminal users know it from?

The discussion does not look productive at all. @marmarek said the package was missed by mistake (probably a bug), so, definitely not intentionally, so why would somebody still make assumptions that this was made on purpose after that?

TL;DR: Qubes OS users deserve basic terminal comfort that EVERYBODY on EVERY OS have, except Qubes OS users. For no real reason.