Jump to content

Photo

terminal tab-completion missing! [solved]


  • Please log in to reply
6 replies to this topic

#1 xdunlapx

xdunlapx

    Member

  • Members
  • 20 posts
  • LocationOH, USA

Posted 01 May 2011 - 08:18 AM

I don't have tab autocomplete in lxterminal when I'm trying to find apps to install. In Ubuntu itself I could tab-complete package names or if i only spelled the first few letters right it would show me a list of available packages that match that first few set of letters. Is that an easy thing to install, tab completion? I really miss that. I've had to open synaptic more times than I can count to search for and install a package.

Brittany
Posted Image "For the love of Bodhi!"



A big thank you to everyone who contributes to Bodhi Linux


#2 ylee

ylee

    King of the Software Page

  • Moderators
  • 1585 posts
  • LocationSouth Carolina, USA

Posted 01 May 2011 - 11:48 AM

I don't have tab autocomplete in lxterminal when I'm trying to find apps to install. In Ubuntu itself I could tab-complete package names or if i only spelled the first few letters right it would show me a list of available packages that match that first few set of letters. Is that an easy thing to install, tab completion? I really miss that. I've had to open synaptic more times than I can count to search for and install a package.

Brittany


How very weird. Does tab-completion work for other commands like cd? Are you sure you are doing it right? It is working for me, if i type sudo apt-get install ax and then hit tab twice it will show me a list like:

robert@acer:~$ apt-get install ax
ax25-apps           axel-dbg                    axiom-hypertex-data
ax25mail-utils     axel-kapt                   axiom-source
ax25spyd            axiom                        axiom-test
ax25-tools          axiom-databases        axiom-tex
ax25-utils           axiom-doc                  axp
ax25-xtools         axiom-graphics           axparafit
axe                     axiom-graphics-data   axpcoords
axel                    axiom-hypertex

If not is bash-completion installed, it should be installed by default but if not you certainly need it. If it is installed maybe reinstalling would help.

Does your .bashrc file contain the lines below, note this is a hidden file in your home directory:

# enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
if [ -f /etc/bash_completion ] && ! shopt -oq posix; then
    . /etc/bash_completion
fi

That is all I can think of right now and if none of that works I am not certain what is wrong as I can't duplicate the problem.

"No technology can ever be too arcane or complicated for the black t-shirt crowd."


#3 xdunlapx

xdunlapx

    Member

  • Members
  • 20 posts
  • LocationOH, USA

Posted 01 May 2011 - 03:15 PM

Yes tab-completion works for "cd". I just tried to install bash-completion and it says it's already installed. Odd. I just reinstalled it and it didnt fix it.

Edit: That's odd. When I reinstalled bash-completion nm-applet was killed, disconnecting me from the internet.. I had to restart nm-applet.
Posted Image "For the love of Bodhi!"

#4 ylee

ylee

    King of the Software Page

  • Moderators
  • 1585 posts
  • LocationSouth Carolina, USA

Posted 01 May 2011 - 03:31 PM

Yes tab-completion works for "cd". I just tried to install bash-completion and it says it's already installed. Odd. I just reinstalled it and it didnt fix it.

Edit: That's odd. When I reinstalled bash-completion nm-applet was killed, disconnecting me from the internet.. I had to restart nm-applet.


Does your bashrc file look ok, contain the code i gave above? Are you sure bash is reading it? Add a line like echo "here i am" at the end of .bashrc and see if that line is printed when you start the terminal. Have you altered or edited .bashrc before or the file .profile (also in home folder)?

There is also a package called bash-completion-lib which i have never used but provides the same functionality. You might try it but maybe ya have to remove bash-completion first. Honestly I am not sure.

"No technology can ever be too arcane or complicated for the black t-shirt crowd."


#5 xdunlapx

xdunlapx

    Member

  • Members
  • 20 posts
  • LocationOH, USA

Posted 01 May 2011 - 03:37 PM

That's odd. I don't have a .bashrc file. Shall I create and add that code to the .bashrc?

I have not altered any files on my system other than doing a apt-get update && apt-get upgrade.
Posted Image "For the love of Bodhi!"

#6 ylee

ylee

    King of the Software Page

  • Moderators
  • 1585 posts
  • LocationSouth Carolina, USA

Posted 01 May 2011 - 03:51 PM

That's odd. I don't have a .bashrc file. Shall I create and add that code to the .bashrc?

I have not altered any files on my system other than doing a apt-get update && apt-get upgrade.


you probably know this but .bashrc is a hidden file, so you can't see it until you do a CTRL-H or view -show hidden i think in PcManFM.

You should have one and you should also have a .profile file. below is the code found in .bashrc on a default install. I alter mine all the time so I had to get one off of a live cd because mine is highly customized.


# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples

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

# don't put duplicate lines in the history. See bash(1) for more options
# ... or force ignoredups and ignorespace
HISTCONTROL=ignoredups:ignorespace

# append to the history file, don't overwrite it
shopt -s histappend

# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
HISTSIZE=1000
HISTFILESIZE=2000

# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize

# make less more friendly for non-text input files, see lesspipe(1)
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"

# set variable identifying the chroot you work in (used in the prompt below)
if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then
    debian_chroot=$(cat /etc/debian_chroot)
fi

# set a fancy prompt (non-color, unless we know we "want" color)
case "$TERM" in
    xterm-color) color_prompt=yes;;
esac

# uncomment for a colored prompt, if the terminal has the capability; turned
# off by default to not distract the user: the focus in a terminal window
# should be on the output of commands, not on the prompt
#force_color_prompt=yes

if [ -n "$force_color_prompt" ]; then
    if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
    # We have color support; assume it's compliant with Ecma-48
    # (ISO/IEC-6429). (Lack of such support is extremely rare, and such
    # a case would tend to support setf rather than setaf.)
    color_prompt=yes
    else
    color_prompt=
    fi
fi

if [ "$color_prompt" = yes ]; then
    PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
else
    PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
fi
unset color_prompt force_color_prompt

# If this is an xterm set the title to user@host:dir
case "$TERM" in
xterm*|rxvt*)
    PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
    ;;
*)
    ;;
esac

# enable color support of ls and also add handy aliases
if [ -x /usr/bin/dircolors ]; then
    test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -<img src='http://www.bodhilinux.com/forums/public/style_emoticons/<#EMO_DIR#>/cool.gif' class='bbc_emoticon' alt='B)' />"
    alias ls='ls --color=auto'
    #alias dir='dir --color=auto'
    #alias vdir='vdir --color=auto'

    alias grep='grep --color=auto'
    alias fgrep='fgrep --color=auto'
    alias egrep='egrep --color=auto'
fi

# some more ls aliases
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'

# Alias definitions.
# You may want to put all your additions into a separate file like
# ~/.bash_aliases, instead of adding them here directly.
# See /usr/share/doc/bash-doc/examples in the bash-doc package.

if [ -f ~/.bash_aliases ]; then
    . ~/.bash_aliases
fi

# enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
if [ -f /etc/bash_completion ] && ! shopt -oq posix; then
    . /etc/bash_completion
fi

If you don't have this file then yes you need to create it. Copy and paste the above text into a text editor and save it in your home folder as .bashrc

Hope this helps :)

"No technology can ever be too arcane or complicated for the black t-shirt crowd."


#7 xdunlapx

xdunlapx

    Member

  • Members
  • 20 posts
  • LocationOH, USA

Posted 01 May 2011 - 03:55 PM

Yep, that fixed it! Thanks!!
Posted Image "For the love of Bodhi!"




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users