Error on new shells

Aperta
#138 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
42/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
bash, python
Ambito
cli

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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
Lingua principale
Python
Stelle
58
Fork
43
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di linuxmint/mintsystem

Tutte le issue di linuxmint/mintsystem

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.