Skip to content
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

Error on new shells #138

Open
darrenmeehan opened this issue May 14, 2024 · 0 comments
Open

Error on new shells #138

darrenmeehan opened this issue May 14, 2024 · 0 comments

Comments

@darrenmeehan
Copy link

When creating a new shell I get the following error in my terminal.
I've tracked it down to etc/bash_completion.d/apt-linux-mint which this repository. I'm using version 8.5.8

Command 'have' not found, did you mean:
  command 'dave' from deb libhttp-dav-perl (0.49-2)
  command 'haxe' from deb haxe (1:4.2.4-1build1)
  command 'save' from deb atfs (1.4pl6-15)
  command 'havp' from deb havp (0.93-2build1)
Try: sudo apt install <deb name>
$ 

I'm not quite sure what fix to make for this, I've patched my own system. But I am unsure if there's anything not obvious. I assume this problem would be happening to a lot of people if it was an issue.. I've been experimenting with Nix's home-manager on my system so it's tainted.

Should this script be able to assume that apt is installed. It's marked as a required dependency.

I've applied this patch to my own version locally. If I get time, I'll investigate on a fresh system.

mac@mac-MacBookPro:~/code/mintsystem$ git diff -u
diff --git a/etc/bash_completion.d/apt-linux-mint b/etc/bash_completion.d/apt-linux-mint
index 524eed5..5c84cc8 100644
--- a/etc/bash_completion.d/apt-linux-mint
+++ b/etc/bash_completion.d/apt-linux-mint
@@ -2,7 +2,9 @@
 # Bash completion file for Linux Mint apt utility.
 #
 
-have apt &&
+if ! command -v apt &> /dev/null; then
+    return 1
+fi
 _apt()
 {
     local cur opt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant