elementary / elementary/triage
Make command-not-found aware of RDNN
- Dominant language
- No language data
- Stars
- 4
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Description
## Problem
RDNN is super nice from a development standpoint, but users have pointed out that it is less convenient for folks using the terminal. For example, you can't just type `code filename.ext` to open a file in Code, or `files .` to open Files in the current directory; instead, you have to know and remember the unwieldy RDNN. This is exasperated when trying to launch third-party apps where the user might not even know the RDNN.
Up to now we've recommended users set their own aliases (which I have also done!), but it would be better to handle this better out of the box.
## Proposal
`command-not-found` is responsible for suggesting to install packages when an invalid command is typed; for example, typing `code` when a binary or alias named exactly `code` can't be found, `command-not-found` will offer up potential matches from the Ubuntu repos:
```
Command 'code' not found, did you mean:
command 'tcode' from deb emboss
command 'cobe' from deb python-cobe
command 'cde' from deb cde
command 'node' from deb nodejs
command 'ode' from deb plotutils
command 'cdde' from deb cdde
Try: sudo apt install
```
or, if snap is installed:
```
Command 'code' not found, but can be installed with:
sudo snap install code
```
It would be interesting if that could be extended to be made aware of RDNN schemes, similar to how `flatpak install` will offer to install partial matches for RDNNs. So for example, the output for `code` could be:
```
Command 'code' not found, but a similar command is available:
io.elementary.code
```
This would at least help people learn the correct commands, and would not conflict with installed binaries. If this route works, we could consider making it more interactive and smarter, like:
```
Command 'code' not found, but a similar command is available:
io.elementary.code
Run `io.elementary.code`? [Y]es [n]o [a]lways
```
…but that's getting a lot more complex.
## Prior Art
Ubuntu has apparently modified `command-not-found` to offer and prefer snaps. Flatpak's `flatpak install` does partial RDNN matching.
Contributor guide
Assessment
This issue has not been assessed yet.