Error on new shells

Ouverte
#138 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

Évaluation

Difficulté
2/5
Temps estimé
1-3 heures
Accessibilité débutants
42/100
Type d'issue
Bug
Clarté
Plutôt claire
Activité
À l'abandon
Stack technique
bash, python
Domaine
cli

Piste de recherche

Start by reading etc/bash_completion.d/apt-linux-mint and checking how its have helper is provided when a new shell loads the completion file. The report includes a local guard for missing apt; verify the behavior on a fresh system and check whether the required dependency makes that guard appropriate. Done means new shells no longer print the reported error in the relevant environment, with completion still working when apt is installed.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

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
Langage dominant
Python
Étoiles
58
Forks
43
Métriques de merge des PR
Aucune PR mergée en 30 j

Préparer son environnement

Ce projet ne fournit ni conteneur de développement, ni Dockerfile, ni guide de contribution : l'installation est à votre charge. Commencez par son README, et consultez notre guide de la première contribution pour les étapes générales.

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de linuxmint/mintsystem

Toutes les issues de linuxmint/mintsystem

Issues similaires

Plus d'issues Python

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.