Pagina 1 di 1

[Risolto] autocompletamento terminale

Inviato: domenica 5 dicembre 2010, 21:56
da Roger84
Ciao a tutti, avrei una piccola domanda:

Nelle versioni più vecchie di ubuntu il terminale aveva una funzione di autocompletamento non solo per file e cartelle ma anche per le applicazioni installate. Il problema che vi pongo è semplice: come posso riattivare quella funzione? mi era molto comoda e non riesco a capire se sono stato io a disattivarla o c'è stato qualche cambiamento durante le varie versioni del sistema (mi sembra che sia dalla 9.04 che non mi funzioni più)

Sto cercando sia su internet che sul forum ma non ho trovato nulla che riguardi questo problema

Re: autocompletamento terminale

Inviato: domenica 5 dicembre 2010, 23:27
da takeshi
Hai il pacchetto bash-completion?

Re: autocompletamento terminale

Inviato: lunedì 6 dicembre 2010, 8:06
da tokijin
Oltre al consiglio di takeshi, controllo poi che le righe

Codice: Seleziona tutto

# enable bash completion in interactive shells
if [ -f /etc/bash_completion ] && ! shopt -oq posix; then
    . /etc/bash_completion
fi
del file

Codice: Seleziona tutto

/etc/bash.bashrc
siano decommentate

Re: autocompletamento terminale

Inviato: lunedì 6 dicembre 2010, 22:24
da Roger84
il pacchetto suggerito era installato ma erano comm. le righe del file bash.bashrc. Ora non posso provare se ho risolto il problema. Appena posso vi faccio sapere.
Grazie a tutti (good)

Re: autocompletamento terminale

Inviato: lunedì 6 dicembre 2010, 22:50
da fireman
Anche io volevo attivare questa funzione ma non appena apro il terminale, dopo aver fatto le modifiche che avete suggerito, mi dà questo errore:
bash: /etc/bash.bashrc: line 12: syntax error near unexpected token `('
bash: /etc/bash.bashrc: line 12: `set variable identifying the chroot you work in (used in the prompt below)'
Questo è il file in questione (scusate il gioco di parole  ;D)

Codice: Seleziona tutto

# System-wide .bashrc file for interactive bash(1) shells.

# To enable the settings / commands in this file for login shells as well,
# this file has to be sourced in /etc/profile.

# If not running interactively, don't do anything
[ -z "$PS1" ] && return

# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize
set variable identifying the chroot you work in (used in the prompt below)
if [ -z "~" ] && [ -r /etc/debian_chroot ]; then
    debian_chroot=$(cat /etc/debian_chroot)
fi

# set a fancy prompt (non-color, overwrite the one in /etc/profile)
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '

# Commented out, don't overwrite xterm -T "title" -n "icontitle" by default.
# If this is an xterm set the title to user@host:dir
#case "$TERM" in
#xterm*|rxvt*)
#    PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD}\007"'
#    ;;
#*)
#    ;;
#esac

# enable bash completion in interactive shells
if [ -f /etc/bash_completion ] && ! shopt -oq posix; then
    . /etc/bash_completion
fi

# sudo hint
if [ ! -e "$HOME/.sudo_as_admin_successful" ]; then
    case " $(groups) " in *\ admin\ *)
    if [ -x /usr/bin/sudo ]; then
	cat <<-EOF
	To run a command as administrator (user "root"), use "sudo <command>".
	See "man sudo_root" for details.
	
	EOF
    fi
    esac
fi

# if the command-not-found package is installed, use it
if [ -x /usr/lib/command-not-found -o -x /usr/share/command-not-found ]; then
	function command_not_found_handle {
	        # check because c-n-f could've been removed in the meantime
                if [ -x /usr/lib/command-not-found ]; then
		   /usr/bin/python /usr/lib/command-not-found -- $1
                   return $?
                elif [ -x /usr/share/command-not-found ]; then
		   /usr/bin/python /usr/share/command-not-found -- $1
                   return $?
		else
		   return 127
		fi
	}
fi

Cosa ho sbagliato e devo correggere?
Grazie

Re: autocompletamento terminale

Inviato: martedì 7 dicembre 2010, 12:54
da takeshi
Hai decommentato la dodicesima riga; reinseriscila tra i commenti:

Codice: Seleziona tutto

# set variable identifying the chroot you work in (used in the prompt below)

Re: autocompletamento terminale

Inviato: martedì 7 dicembre 2010, 13:19
da Roger84
perfetto (good)
il risultato è stato quello sperato decommentando le righe nel file
grazie a tutti (b2b)

Re: autocompletamento terminale

Inviato: martedì 7 dicembre 2010, 13:23
da clerville6
Roger84 ha scritto: perfetto (good)
il risultato è stato quello sperato decommentando le righe nel file
grazie a tutti (b2b)
(good) Allora ricordati di mettere [Risolto] nel titolo del primo post!

Re: [Risolto] autocompletamento terminale

Inviato: martedì 7 dicembre 2010, 13:27
da Roger84
Allora ricordati di mettere [Risolto] nel titolo del primo post!
Fatto  (good)