Using Tab Completion

I am just starting to work with command-line navigation in terminal. They say "tab completion" is a absolute time-saving feature.
It worked for me the first time, but now it doesn't. At my home folder, I enter cd, then p and press the Tab key. After pressing the tab key a second time, it should display all choices beginning with p. Nothing happens. Any ideas?

baltwo wrote:
Hmmm! I have a simple bash shell set up and all I get is the alert sound. Maybe you're using another shell or have something else set that accounts for the discrepancy.
Nope. I'm using the system default bash. If I try to complete something that isn't there, such as "cd p", I get an alert. If I try something that has possible completions, like "cd P", I get a list of the directories.

Similar Messages

  • Useful tab-completion for .bashrc

    I was searching for a tab completion in systemd commands such as:
    $ systemct <TAB> (this show all possible parameters/flags) and another <TAB> (show all units and itself commands).
    Reading posts here and there I found that the following command in .bashrc:
    complete -F or -C command
    did the trick, but this is awful and painfull  cause I need to implement it in all commands, such as, pacman, man, sudo, etc. Ok, googling, I found this usefull script you can put in your .bashrc:
    # completion.bash
    _vault_complete() {
    COMPREPLY=()
    local word="${COMP_WORDS[COMP_CWORD]}"
    local completions="$(vault --cmplt "$word")"
    COMPREPLY=( $(compgen -W "$completions" -- "$word") )
    complete -f -F _vault_complete vault
    This will complete all your commands with infinite posibilities. (This example use command vault, you can use whatever you want)
    I put the link (well explained) here because there is a way to do it in zshell for those interested on it.
    http://goo.gl/RFwgK
    I hope this can be help someone.
    Cheers
    Maybe would be useful to put this script on the bashrc wiki.
    Last edited by JohnnyDeacon (2013-05-21 13:21:21)

    firecat53 wrote:
    Just wondering if you actually tested this first...from what I read on the link you provided, this script fragment provided completion for the 'vault' command only if I'm understanding it correctly. In order to make this work for any command, you would have to repeat that shell fragment for _each_ command. Not sure what this gets you over just using 'complete -cf <cmd>'.
    I think the author was just explaining how to create a bash completion script for an arbitrary command that could be included along with that command. Most software packages have those bash completion scripts already included. This could be used for a command that doesn't include that script already. If that's what you intended with your post it wasn't clear to me :-)
    Scott
    Edit:  I also just noticed that without even having 'complete -cf systemctl' in my .bashrc, bash is still giving me a list of possible systemctl options when I hit <TAB> after typing systemctl. Ooo, nice! Never noticed that before
    complete -cf <cmd> does not complete with flags and parameters.
    I have noticed about a script called bash-completion on repos that do completion very well, I'll check it out if it works with all commands.

  • PowerShell Script Module PreCache Ignores DefaultCommandPrefix in Manifest - Results in Tab Completion Errors

    Refer to this thread for background...
    https://social.technet.microsoft.com/Forums/windowsserver/en-US/6507710a-5648-4f52-8d46-3bf6c75ac7f3/module-function-name-resolution-issues-with-defaultcommandprefix?forum=winserverpowershell
    The issue is when PowerShell auto loads the meta data into the CommandAnalysis cache it loads the functions defined in a script module (*.psm1) without consideration that a manifest file (*.psd1) may contain a DefaultCommandPrefix declaration. As a result
    if a user attempts to enter a function using tab completion PowerShell will offer the name as defined in the script module which fails to execute (name not recognized). Importing the module will make the correct name with prefix available for tab completion.
    My recommended approach would be to include the DefaultCommandPrefix in the meta data cache during the initial population as a session is instantiated. Also, when a module is loaded explicitly by a user who specifies a -Prefix value the old references containing
    the DefaultCommandPrefix would need to be removed.
    William Busby, PMP

    Hi William,
    yes, that's something you'll either have to do the hard way or live with admin confusion.
    If you're using Sapien's PowerShell Studio as an Editor (hint: Usually a great idea), you can very easily rename a function, even in a multi-file module project, by rightcklicking on the function-name and selecting "rename".
    Alternatively you can do a bulk rename with Powershell:
    Get all functions in your module (Load it and check exportedcommands)
    loop over each function-name
    calculate new name
    search your entire project for all references and replace them.
    Let me see ...
    function Rename-ModulePrefix
    [CmdletBinding()]
    Param (
    [Parameter(Position = 0, Mandatory = $true)]
    [string]
    $ModuleName,
    [Parameter(Position = 1, Mandatory = $true)]
    [string]
    $OldPrefix,
    [Parameter(Position = 2, Mandatory = $true)]
    [string]
    $NewPrefix,
    [Parameter(Position = 3)]
    [string]
    $Path
    # Catch all typos
    Import-Module $ModuleName -ErrorAction 'Stop'
    # Get root path if not manually passed
    if (-not $PSBoundParameters["Path"])
    $Path = (Get-Module $ModuleName).Path
    # Get module files
    $Files = Get-ChildItem -Path $path -Recurse -Include "*.ps1", "*.psm1", "*.psd1"
    # Iterate over each file
    foreach ($file in $Files)
    # Null variable in case you get an empty file somewhere and run this from Win 7
    $data = $null
    # Get Content of file
    $data = Get-Content $file
    # Replace strings
    foreach ($c in (Get-Module $ModuleName).ExportedCommands)
    $newName = $c.Name -replace $OldPrefix, $NewPrefix
    $data = $data | ForEach-Object { $_ -replace $c.Name, $newName }
    # Write back to file
    $data | Set-Content $file
    While I didn't proof it, in theory this should do it (Make a backup before running it :) ).
    Cheers,
    Fred
    There's no place like 127.0.0.1

  • "Tab Completion" closing console sessions

    Starting this morning I find that pressing the TAB key terminates console sessions. For instance, running KDE as a user if I run "konsole", then su to root - pressing tab will return me to user console and pressing tab again will close konsole app (Session shell exited with signal 11).
    A text console (ctl-alt-f1) will also terminate pressing tab so not an X problem.
    I did a pacman -Suy yesterday and sed, dbus and vte packages were updated but I can't see anything in those. Dodgy keyboard? I don't know much about termcaps so am a bit stuck.
    A nuisance as I use tab completion quite often.
    EDIT: Hmm, rebooted and problem has gone!

    byte wrote:Can you specify somewhere to use a login shell (bash -l)?
    Normally .bashrc gets sourced by .bash_profile, and unless it's a login shell nothing will happen.
    I tried running "bash -l" but the shell I get doesn't have bash completion either : (

  • Tab Completion within Terminal

    I'm currently studying the Peachpit book on OSX Support Essentials and have just arrived at the section concerning tab completion in the Terminal. According to the book, if I start from my home folder, then type P, and then press the Tab key, I should get all the choices available to me within the home folder that start with P. I tried this and it worked for me once. Now, however, after restarting, if I do the same thing, I get only one choice - PPCExplain, which is located in Developer/usr/bin/, and not in my home directory. Thinking a preferences must have gotten screwed up, I deleted the preferences for the Terminal, and restarted - still I get this one result and have no explanation of why this command worked as the book said it would and now it doesn't. I'm quite positive I'm starting from my user folder. Any idea what's going on here? Thanks.

    Your terminal is working correctly. In unix-based systems, tab completion is situation-dependent, and for the most part is relative to the root of the drive. If you open a terminal and type P<tab> it will list all commands that are included in your $PATH variable. The $PATH contains file locations (starting from the drive's root) for all the commonly used utilities. To see what the $PATH contains, type the following command in the terminal:
    echo $PATH
    This command will output something like: /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin
    All the paths listed there are targeted when you enter a command. When you press "P<tab>" the system looks for something in these directories that begins with a "P". The terminal assumes "/usr/bin/", "/bin", and the other paths have already been entered, so typing "P" just completes the path from there.
    If you want to run the command "top" which shows all your running processes (similar to activity monitor) is located in the "/usr/bin" directory. Since that directory is in your $PATH, all you have to do is type "top" and press enter. For longer and unique commands you can use tab completion.
    Running "top" as described above is the exact same thing as running "/usr/bin/top". This is the command that is actually run, but having the rest of the file path in the $PATH variable makes it easier than having to type out the whole command.
    As for directories and user files, they're accessed from the root ("/") as well. If you want to access your user folder and show the contents in it via tab completion, start at the root of your drive, as follows:
    /Users/username/<tab>
    Press tab twice to show the available commands or paths. If you want to change your current directory to a new folder, type "cd" before the full file path, as such:
    cd /Users/username/Desktop
    Unix bases everything from the root of the drive as I explained above. However, there are some ways to simplify commands instead of having to type the whole command path before the command itself, or to target a specific file or folder without having to enter the path for the file/folder. These are the period, and the tilde keys: ".", "..", "~".
    To reference the current folder, use the ".", and to reference the parent folder type "..". To reference the user home folder type "~". Other than these options, everything is assumed to be referenced from the root of the drive "/".
    As such, you can change to your home folder these ways:
    cd ~
    cd /Users/username
    These commands perform the same function. The tilde (~) just indicates the current user's home folder, so you dont have to always enter "/Users/username" whenever you want to target something in your home folder.
    Lets take your home folder for example. I'll assume your home's name is "jcoyle".
    If you want to reference your desktop, you are currently trying to do it by pressing "D" and the pressing tab. This wont work. To reference your desktop you'll need to start at the root, or at some of the shortcuts provided by Unix (namely the tilde):
    /Users/jcoyle/Desktop (references from the full path)
    ~/Desktop (references from the user's home folder)
    Continue to press tab to see all the available targets in the desktop folder, and then enter part of the name of one of them and tab-complete it. You can list contents of folders this way.
    Getting back to the periods ("." and ".."), you can reference things relative to your current position. For instance, if you are currently in your Desktop folder, you can change back to your home folder by pressing "cd .." to go up one level. From there you can "cd" into your Movies folder, for example. Alternatively, if you are in your "Desktop" folder you can get to your "Movies" folder directly by typing "cd ../Movies". This tells the computer to go up one level and then target the "Movies" folder that should be there.
    Targeting files and folders like this in the Terminal, however, will not do anything unless the final targeted file is an executable binary file (such as a program). You must perform an action (via a program, ie: one of the commands like "cd") on the referenced path in order to do anything.
    Think about wanting to open TextEdit. You can open it by entering this command:
    /Applications/TextEdit.app/Contents/MacOS/TextEdit
    If you are in the "Applications" directory, you can type the command above, or type:
    ./TextEdit.app/Contents/MacOS/TextEdit
    The period references the current directory ("Applications") and then continues the command from there.
    Say you want to open a file on your desktop called "file.txt" in TextEdit. With the TextEdit program, if you enter the full path of a target file after the command to open the program then the program will try to open that file. For instance, this full command will open the file "file.txt" in the TextEdit program:
    /Applications/TextEdit.app/Contents/MacOS/TextEdit /Users/jcoyle/Desktop/file.txt
    Alternatively, this will work:
    /Applications/TextEdit.app/Contents/MacOS/TextEdit ~/Desktop/file.txt
    (The tilde references the home folder)
    If you are currently in the Applications folder, then this command will also do the same thing:
    ./TextEdit.app/Contents/MacOS/TextEdit ~/Desktop/file.txt
    (The period references the Applications folder itself, so you dont have to type the path before where you currently are located)
    Lastly, if you are in the Applications folder, then this command will also work:
    ../Applications/TextEdit.app/Contents/MacOS/TextEdit ~/Desktop/file.txt
    (the double period references the folder above where you are. In this case it happens to be the root "/" folder, so the full path ends up being what's entered. However, imagine the TextEdit application is in your Desktop folder. In that case if you wanted to open the application (forget about opening files with it for now) you could type these commands (assuming you have just opened the terminal and are currently in your home folder):
    /Users/jcoyle/Desktop/TextEdit.app/Contents/MacOS/TextEdit
    ./Desktop/TextEdit.app/Contents/MacOS/TextEdit
    ~/Desktop/TextEdit.app/Contents/MacOS/TextEdit (in this case the tilde is redundant, since you are already at your home folder)
    ../jcoyle/Desktop/TextEdit.app/Contents/MacOS/TextEdit
    ../../Users/jcoyle/Desktop/TextEdit.app/Contents/MacOS/TextEdit
    The last command invokes two instances of "..", which bring you back two folder levels. In this case, the first would move your reference from "jcoyle" up to the "Users" directory, and from there the second ".." would move you up to the root of the drive "/".
    I hope this long-winded explanation clarifies how paths work in Unix-based systems. Just that by default everything is assumed to be referenced from root, and the included file paths in the $PATH variable is why you see the files from those folders when you just press a letter and tab-complete it.
    It's very logical, but it can be a bit funky to wrap your head around.

  • [SOLVED]mplayer tab completion with *.divx files

    Hi,
    I have some *.divx files. mplayer plays them fine, but the tab completion in bash doesn't work. So I'll either have to type the filename or do something like vim <filename>, go back and write mplayer instead of vim. That's getting pretty annoying, so I hope someone can help me
    Last edited by rine (2008-09-17 00:02:47)

    I assume you use the bash_completition script.
    The easy way is to rename the file to the actual container (avi, mkv, mp4, wmv, whatever)
    The hard way is to patch bash_completition:
    you should add the extensions you like to line 5895: for example
    _filedir '@(mp?(e)g|MP?(E)G|wm[av]|WM[AV]|avi|AVI|asf|ASF|vob|VOB|bin|BIN|dat|DAT|vcd|VCD|ps|PS|pes|PES|fli|FLI|viv|VIV|rm?(j)|RM?(J)|ra?(m)|RA?(M)|yuv|YUV|mov|MOV|qt|QT|mp[34]|MP[34]|og[gm]|OG[GM]|wav|WAV|dump|DUMP|mkv|MKV|m4a|M4A|aac|AAC|m2v|M2V|dv|DV|rmvb|RMVB|mid|MID|ts|TS|3gp|mpc|MPC|flac|FLAC|divx)'

  • Awesome tab completion not working

    Hi,
    I've just upgraded my arch installation to using the awesome WM. However, tab completion refuses to work whe I try launching a program, it just throws me out of the command box.
    Here is my rc.lua:
    http://pastebin.com/ihUDiJT7
    Any help is much appreciated,
    Regards from Switzerland
    Last edited by mark-o-solo (2012-12-12 10:58:38)

    No, I only moved the part:
    I previously wrote:awful.util.spawn_with_shell("xbindkeys")
    awful.util.spawn_with_shell("wicd-client --tray ")
    awful.util.spawn_with_shell("conky")
    awful.util.spawn_with_shell("synaptikscfg init")
    to xinitrc. I am also aware that awesome takes the default in case something goes wrong. I tried the default still no tab completion.
    Could it be related to some keygrabber in the background ? I also tried killing xbindkeys - no result. Could it somehow be related to my previous LXDE setup ?

  • Is it possible to have a kind of tab completion for dcpromo parameters

    hi friends
    i need to directly type in the following code into cmd in windows server 2008 R2
    is there any trick or 3rd-party Application to make it easier, i mean adding some kind of tab completion here?
    i don't want to user answer file, imagine i haven't created an answer file & so it's not available now. i need directly type in the entire code
    i asked this question in group policy forum & they guide me to post it here
    thanks in advanced

    You can "add" tab completion / intellisense to Powershell cmdlets that don't have it by creating a proxy function that uses dynamic parameters as
    shown in this example.
    I suppose you can do the same by creating a wrapper PS function for dcpromo tool..
    Sam Boutros, Senior Consultant, Software Logic, KOP, PA http://superwidgets.wordpress.com (Please take a moment to Vote as Helpful and/or Mark as Answer, where applicable) _________________________________________________________________________________
    Powershell: Learn it before it's an emergency http://technet.microsoft.com/en-us/scriptcenter/powershell.aspx http://technet.microsoft.com/en-us/scriptcenter/dd793612.aspx

  • SVN Tab Complete issues (space after each complete)

    Morning all,
    I've got a weird issue with my SVN tab complete using Bash, it adds a space after each item it completes - for example: Say there is a directory 'foobar' with a file 'zomg' within that, I'd type 'svn add fo' and then hit tab - however, this results in 'svn add foobar ' (note the space). This is highly annoying, as I can no longer hit 'z' then tab to complete it to 'foobar/zomg', I have to remove the space, then go again (it does it for everything, so adding something like 'foobar/zomg/wtf/bbq' is a nightmare.)
    So far it only does it with Bash, I've not been able to test it on other shells. Subversion 1.4.6-4 on an up-to-date Arch install with core, extra and community repos enabled (however it has done it from the very start of me using Arch, so it's not a recent update that killed it).
    Regards,
    Last edited by AlexC_ (2008-09-20 16:13:48)

    Hi AlexC_ :-)
    I suspect that it may be an issue with /etc/bash_completion. This is the relevant part from my /etc/bash_completion.
    # svn completion
    have svn &&
    _svn()
    local cur prev commands options command
    COMPREPLY=()
    cur=${COMP_WORDS[COMP_CWORD]}
    commands='add blame praise annotate ann cat checkout co cleanup commit \
    ci copy cp delete del remove rm diff di export help ? h import \
    info list ls lock log merge mkdir move mv rename ren \
    propdel pdel pd propedit pedit pe propget pget pg \
    proplist plist pl propset pset ps resolved revert \
    status stat st switch sw unlock update up'
    if [[ $COMP_CWORD -eq 1 ]] ; then
    if [[ "$cur" == -* ]]; then
    COMPREPLY=( $( compgen -W '--version' -- $cur ) )
    else
    COMPREPLY=( $( compgen -W "$commands" -- $cur ) )
    fi
    else
    prev=${COMP_WORDS[COMP_CWORD-1]}
    case $prev in
    --config-dir)
    _filedir -d
    return 0;
    -@(F|-file|-targets))
    _filedir
    return 0;
    --encoding)
    COMPREPLY=( $( compgen -W \
    '$( iconv --list | sed -e "s@//@@;" )' \
    -- "$cur" ) )
    return 0;
    --@(editor|diff|diff3)-cmd)
    COMP_WORDS=(COMP_WORDS[0] $cur)
    COMP_CWORD=1
    _command
    return 0;
    esac
    command=${COMP_WORDS[1]}
    if [[ "$cur" == -* ]]; then
    # possible options for the command
    case $command in
    add)
    options='--auto-props --no-auto-props \
    --force --targets --no-ignore \
    --non-recursive -N -q --quiet'
    @(blame|annotate|ann|praise))
    options='-r --revisions --username \
    --password --no-auth-cache \
    --non-interactive -v \
    --verbose --incremental --xml'
    cat)
    options='-r --revision --username \
    --password --no-auth-cache \
    --non-interactive'
    @(checkout|co))
    options='-r --revision -q --quiet -N \
    --non-recursive --username \
    --password --no-auth-cache \
    --non-interactive \
    --ignore-externals'
    cleanup)
    options='--diff3-cmd'
    @(commit|ci))
    options='-m --message -F --file \
    --encoding --force-log -q \
    --quiet --non-recursive -N \
    --targets --editor-cmd \
    --username --password \
    --no-auth-cache \
    --non-interactive --no-unlock'
    @(copy|cp))
    options='-m --message -F --file \
    --encoding --force-log -r \
    --revision -q --quiet \
    --editor-cmd -username \
    --password --no-auth-cache \
    --non-interactive'
    @(delete|del|remove|rm))
    options='--force -m --message -F \
    --file --encoding --force-log \
    -q --quiet --targets \
    --editor-cmd -username \
    --password --no-auth-cache \
    --non-interactive'
    @(diff|di))
    options='-r --revision -x --extensions \
    --diff-cmd --no-diff-deleted \
    -N --non-recursive --username \
    --password --no-auth-cache \
    --non-interactive --force \
    --old --new --notice-ancestry'
    export)
    options='-r --revision -q --quiet \
    --username --password \
    --no-auth-cache \
    --non-interactive -N \
    --non-recursive --force \
    --native-eol --ignore-externals'
    import)
    options='--auto-props --no-auto-props \
    -m --message -F --file \
    --encoding --force-log -q \
    --quiet --non-recursive \
    --no-ignore --editor-cmd \
    --username --password \
    --no-auth-cache \
    --non-interactive'
    info)
    options='--username --password \
    --no-auth-cache \
    --non-interactive -r \
    --revision --xml --targets \
    -R --recursive --incremental'
    @(list|ls))
    options='-r --revision -v --verbose -R \
    --recursive --username \
    --password --no-auth-cache \
    --non-interactive \
    --incremental --xml'
    lock)
    options='-m --message -F --file \
    --encoding --force-log \
    --targets --force --username \
    --password --no-auth-cache \
    --non-interactive'
    log)
    options='-r --revision -v --verbose \
    --targets --username \
    --password --no-auth-cache \
    --non-interactive \
    --stop-on-copy --incremental \
    --xml -q --quiet --limit'
    merge)
    options='-r --revision -N \
    --non-recursive -q --quiet \
    --force --dry-run --diff3-cmd \
    --username --password \
    --no-auth-cache \
    --non-interactive \
    --ignore-ancestry'
    mkdir)
    options='-m --message -F --file \
    --encoding --force-log -q \
    --quiet --editor-cmd \
    --username --password \
    --no-auth-cache \
    --non-interactive'
    @(move|mv|rename|ren))
    options='-m --message -F --file \
    --encoding --force-log -r \
    --revision -q --quiet \
    --force --editor-cmd \
    --username --password \
    --no-auth-cache \
    --non-interactive'
    @(propdel|pdel|pd))
    options='-q --quiet -R --recursive -r \
    --revision --revprop \
    --username --password \
    --no-auth-cache \
    --non-interactive'
    @(propedit|pedit|pe))
    options='-r --revision --revprop \
    --encoding --editor-cmd \
    --username --password \
    --no-auth-cache \
    --non-interactive --force'
    @(propget|pget|pg))
    options='-R --recursive -r --revision \
    --revprop --strict --username \
    --password --no-auth-cache \
    --non-interactive'
    @(proplist|plist|pl))
    options='-v --verbose -R --recursive \
    -r --revision --revprop -q \
    --quiet --username --password \
    --no-auth-cache \
    --non-interactive'
    @(propset|pset|ps))
    options='-F --file -q --quiet \
    --targets -R --recursive \
    --revprop --encoding \
    --username --password \
    --no-auth-cache \
    --non-interactive -r \
    --revision --force'
    resolved)
    options='--targets -R --recursive -q \
    --quiet'
    revert)
    options='--targets -R --recursive -q \
    --quiet'
    @(status|stat|st))
    options='-u --show-updates -v \
    --verbose -N --non-recursive \
    -q --quiet --username \
    --password --no-auth-cache \
    --non-interactive --no-ignore \
    --ignore-externals \
    --incremental --xml'
    @(switch|sw))
    options='--relocate -r --revision -N \
    --non-recursive -q --quiet \
    --username --password \
    --no-auth-cache \
    --non-interactive --diff3-cmd'
    unlock)
    options='--targets --force --username \
    --password --no-auth-cache \
    --non-interactive'
    @(update|up))
    options='-r --revision -N \
    --non-recursive -q --quiet \
    --username --password \
    --no-auth-cache \
    --non-interactive \
    --diff3-cmd --ignore-externals'
    esac
    options="$options --help -h --config-dir"
    COMPREPLY=( $( compgen -W "$options" -- $cur ) )
    else
    if [[ "$command" == @(help|h|\?) ]]; then
    COMPREPLY=( $( compgen -W "$commands" -- $cur ) )
    else
    _filedir
    fi
    fi
    fi
    return 0
    complete -F _svn $default svn
    _svnadmin()
    local cur prev commands options mode
    COMPREPLY=()
    cur=${COMP_WORDS[COMP_CWORD]}
    commands='create deltify dump help ? hotcopy list-dblogs \
    list-unused-dblogs load lslocks lstxns recover rmlocks \
    rmtxns setlog verify'
    if [[ $COMP_CWORD -eq 1 ]] ; then
    if [[ "$cur" == -* ]]; then
    COMPREPLY=( $( compgen -W '--version' -- $cur ) )
    else
    COMPREPLY=( $( compgen -W "$commands" -- $cur ) )
    fi
    else
    prev=${COMP_WORDS[COMP_CWORD-1]}
    case $prev in
    --config-dir)
    _filedir -d
    return 0;
    --fs-type)
    COMPREPLY=( $( compgen -W 'fsfs bdb' -- $cur ) )
    return 0;
    esac
    command=${COMP_WORDS[1]}
    if [[ "$cur" == -* ]]; then
    # possible options for the command
    case $command in
    create)
    options='--bdb-txn-nosync \
    --bdb-log-keep --config-dir \
    --fs-type'
    deltify)
    options='-r --revision -q --quiet'
    dump)
    options='-r --revision --incremental \
    -q --quiet --deltas'
    hotcopy)
    options='--clean-logs'
    load)
    options='--ignore-uuid --force-uuid \
    --parent-dir -q --quiet \
    --use-pre-commit-hook \
    --use-post-commit-hook'
    rmtxns)
    options='-q --quiet'
    setlog)
    options='-r --revision --bypass-hooks'
    esac
    options="$options --help -h"
    COMPREPLY=( $( compgen -W "$options" -- $cur ) )
    else
    if [[ "$command" == @(help|h|\?) ]]; then
    COMPREPLY=( $( compgen -W "$commands" -- $cur ) )
    else
    _filedir
    fi
    fi
    fi
    return 0
    complete -F _svnadmin $default svnadmin
    _svnlook()
    local cur prev commands options mode
    COMPREPLY=()
    cur=${COMP_WORDS[COMP_CWORD]}
    commands='author cat changed date diff dirs-changed help ? h history \
    info lock log propget pget pg proplist plist pl tree uuid \
    youngest'
    if [[ $COMP_CWORD -eq 1 ]] ; then
    if [[ "$cur" == -* ]]; then
    COMPREPLY=( $( compgen -W '--version' -- $cur ) )
    else
    COMPREPLY=( $( compgen -W "$commands" -- $cur ) )
    fi
    else
    command=${COMP_WORDS[1]}
    if [[ "$cur" == -* ]]; then
    # possible options for the command
    case $command in
    @(author|cat|date|dirs-changed|info|log))
    options='-r --revision -t \
    --transaction'
    changed)
    options='-r --revision -t \
    --transaction --copy-info'
    diff)
    options='-r --revision -t \
    --transaction \
    --no-diff-deleted \
    --no-diff-added \
    --diff-copy-from'
    history)
    options='-r --revision --show-ids'
    prop@(get|list))
    options='-r --revision -t \
    --transaction --revprop'
    tree)
    options='-r --revision -t \
    --transaction --show-ids \
    --full-paths'
    esac
    options="$options --help -h"
    COMPREPLY=( $( compgen -W "$options" -- $cur ) )
    else
    if [[ "$command" == @(help|h|\?) ]]; then
    COMPREPLY=( $( compgen -W "$commands" -- $cur ) )
    else
    _filedir
    fi
    fi
    fi
    return 0
    complete -F _svnlook $default svnlook
    Hope this helps.
    Last edited by alanhaggai (2008-09-21 02:08:12)

  • Tab-completion after directories containing spaces broken

    Hello,
    Some days ago I noticed that tab-completion doesn't work any more on files and directories that contain spaces. I'm pretty sure that it has. I'm using bash (3.1.17-1). I don't know when this happened, but my suspicion is that it is related to the upgrade to readline 5.2. Has anyone else experienced this? (Maybe someone can be a bit more specific than I )
    Hm, here are some other perhaps interesting settings on my system:
    LOCALE="en_US.ISO-8859-1"
    KEYMAP="sv-latin1.map.gz"
    CONSOLEFONT="lat1-16.psfu.gz"
    CONSOLEMAP="8859-1"
    Regards

    Romashka wrote:Probably due to upgrade of readline while bash was not recompiled.
    In bug report somebody mentioned that he recompiled bash against current readline without success in resolving the issue (so did slubman a moment ago). I think that's rather bash itself  or bash/readline (not likely since new bash works properly) problem.
    Anyway I'm stopping before I'll turn this thread into bug system I'm going to watch bug reports since now without "bugging" you (a insectorium in one phrase )
    Thanks a lot for your replies and interest!

  • [SOLVED] ls colors different from tab completion colors

    I've been configuring the colored output of ls and I've got ls colors set, but the colored output from tab completion is different sometimes making it hard to read the files/directories.  Does anyone know where the file that controls the tab completion colors?
    http://i.imgur.com/GwByh.png is a picture showing the issue.
    .dir_colors
    # Configuration file for dircolors, a utility to help you set the
    # LS_COLORS environment variable used by GNU ls with the --color option.
    # Copyright (C) 1996, 1999-2011 Free Software Foundation, Inc.
    # Copying and distribution of this file, with or without modification,
    # are permitted provided the copyright notice and this notice are preserved.
    # The keywords COLOR, OPTIONS, and EIGHTBIT (honored by the
    # slackware version of dircolors) are recognized but ignored.
    # Below, there should be one TERM entry for each termtype that is colorizable
    TERM Eterm
    TERM ansi
    TERM color-xterm
    TERM con132x25
    TERM con132x30
    TERM con132x43
    TERM con132x60
    TERM con80x25
    TERM con80x28
    TERM con80x30
    TERM con80x43
    TERM con80x50
    TERM con80x60
    TERM cons25
    TERM console
    TERM cygwin
    TERM dtterm
    TERM eterm-color
    TERM gnome
    TERM gnome-256color
    TERM jfbterm
    TERM konsole
    TERM kterm
    TERM linux
    TERM linux-c
    TERM mach-color
    TERM mlterm
    TERM putty
    TERM rxvt
    TERM rxvt-256color
    TERM rxvt-cygwin
    TERM rxvt-cygwin-native
    TERM rxvt-unicode
    TERM rxvt-unicode-256color
    TERM rxvt-unicode256
    TERM screen
    TERM screen-256color
    TERM screen-256color-bce
    TERM screen-bce
    TERM screen-w
    TERM screen.rxvt
    TERM screen.linux
    TERM terminator
    TERM vt100
    TERM xterm
    TERM xterm-16color
    TERM xterm-256color
    TERM xterm-88color
    TERM xterm-color
    TERM xterm-debian
    # Below are the color init strings for the basic file types. A color init
    # string consists of one or more of the following numeric codes:
    # Attribute codes:
    # 00=none 01=bold 04=underscore 05=blink 07=reverse 08=concealed
    # Text color codes:
    # 30=black 31=red 32=green 33=yellow 34=blue 35=magenta 36=cyan 37=white
    # Background color codes:
    # 40=black 41=red 42=green 43=yellow 44=blue 45=magenta 46=cyan 47=white
    #NORMAL 00 # no color code at all
    #FILE 00 # regular file: use no color at all
    #RESET 0 # reset to "normal" color
    DIR 01;34 # directory
    LINK 01;36 # symbolic link. (If you set this to 'target' instead of a
    # numerical value, the color is as for the file pointed to.)
    MULTIHARDLINK 00 # regular file with more than one link
    FIFO 40;33 # pipe
    SOCK 01;35 # socket
    DOOR 01;35 # door
    BLK 40;33;01 # block device driver
    CHR 40;33;01 # character device driver
    ORPHAN 40;31;01 # symlink to nonexistent file, or non-stat'able file
    SETUID 37;41 # file that is setuid (u+s)
    SETGID 30;40 # file that is setgid (g+s)
    CAPABILITY 30;41 # file with capability
    STICKY_OTHER_WRITABLE 32;40 # dir that is sticky and other-writable (+t,o+w)
    OTHER_WRITABLE 35;40 # dir that is other-writable (o+w) and not sticky
    STICKY 37;44 # dir with the sticky bit set (+t) and not other-writable
    # This is for files with execute permission:
    EXEC 01;32
    # List any file extensions like '.gz' or '.tar' that you would like ls
    # to colorize below. Put the extension, a space, and the color init string.
    # (and any comments you want to add after a '#')
    # If you use DOS-style suffixes, you may want to uncomment the following:
    #.cmd 01;32 # executables (bright green)
    #.exe 01;32
    #.com 01;32
    #.btm 01;32
    #.bat 01;32
    # Or if you want to colorize scripts even if they do not have the
    # executable bit actually set.
    #.sh 01;32
    #.csh 01;32
    # archives or compressed (bright red)
    .tar 01;31
    .tgz 01;31
    .arj 01;31
    .taz 01;31
    .lzh 01;31
    .lzma 01;31
    .tlz 01;31
    .txz 01;31
    .zip 01;31
    .z 01;31
    .Z 01;31
    .dz 01;31
    .gz 01;31
    .lz 01;31
    .xz 01;31
    .bz2 01;31
    .bz 01;31
    .tbz 01;31
    .tbz2 01;31
    .tz 01;31
    .deb 01;31
    .rpm 01;31
    .jar 01;31
    .war 01;31
    .ear 01;31
    .sar 01;31
    .rar 01;31
    .ace 01;31
    .zoo 01;31
    .cpio 01;31
    .7z 01;31
    .rz 01;31
    # image formats
    .jpg 01;35
    .jpeg 01;35
    .gif 01;35
    .bmp 01;35
    .pbm 01;35
    .pgm 01;35
    .ppm 01;35
    .tga 01;35
    .xbm 01;35
    .xpm 01;35
    .tif 01;35
    .tiff 01;35
    .png 01;35
    .svg 01;35
    .svgz 01;35
    .mng 01;35
    .pcx 01;35
    .mov 01;35
    .mpg 01;35
    .mpeg 01;35
    .m2v 01;35
    .mkv 01;35
    .ogm 01;35
    .mp4 01;35
    .m4v 01;35
    .mp4v 01;35
    .vob 01;35
    .qt 01;35
    .nuv 01;35
    .wmv 01;35
    .asf 01;35
    .rm 01;35
    .rmvb 01;35
    .flc 01;35
    .avi 01;35
    .fli 01;35
    .flv 01;35
    .gl 01;35
    .dl 01;35
    .xcf 01;35
    .xwd 01;35
    .yuv 01;35
    .cgm 01;35
    .emf 01;35
    # http://wiki.xiph.org/index.php/MIME_Types_and_File_Extensions
    .axv 01;35
    .anx 01;35
    .ogv 01;35
    .ogx 01;35
    # audio formats
    .aac 00;36
    .au 00;36
    .flac 00;36
    .mid 00;36
    .midi 00;36
    .mka 00;36
    .mp3 00;36
    .mpc 00;36
    .ogg 00;36
    .ra 00;36
    .wav 00;36
    # http://wiki.xiph.org/index.php/MIME_Types_and_File_Extensions
    .axa 00;36
    .oga 00;36
    .spx 00;36
    .xspf 00;36
    I'm using zsh.
    Last edited by livinglifeback (2011-08-13 18:52:03)

    I myself just uses the standard colors and don't change them from default, but I do get the same colors for both ls and completion with this in .zshrc:
    eval `dircolors -b`
    zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS}

  • Bash tab completion broken

    Hi all,
    Probably a dumb question but google has been no help this afternoon but basically my problem is thus:
    In my vnc sessions I cannot tab complete...anything at all.... yet, in putty I can tab just fine.
    Some details...
    bash rc file
    if [ -f /etc/bash_completion ]; then
    . /etc/bash_completion
    fi
    # If not running interactively, don't do anything
    [[ $- != *i* ]] && return
    alias ls='ls --color=auto'
    PS1='[\u@\h \W]\$ '
    system
    uname -a
    Linux Kannagi 2.6.38-ARCH #1 SMP PREEMPT Fri Apr 22 20:29:33 CEST 2011 x86_64 Dual-Core AMD Opteron(tm) Processor 2214 HE AuthenticAMD GNU/Linux
    shell
    echo $SHELL
    /bin/bash
    I have everything installed I believe:
    pacman
    pacman -Q |grep -i bash
    bash 4.2.008-1
    bash-completion 1.3-2
    Any ideas? Something I'm missing?
    Thanks!!

    byte wrote:Can you specify somewhere to use a login shell (bash -l)?
    Normally .bashrc gets sourced by .bash_profile, and unless it's a login shell nothing will happen.
    I tried running "bash -l" but the shell I get doesn't have bash completion either : (

  • Emacs tab completion

    Following is my .emacs file:
    (add-to-list 'load-path
    "~/.emacs.d/plugins")
    (require 'color-theme)
    (require 'pymacs)
    (require 'yasnippet-bundle)
    ;; Initialize Rope
    (pymacs-load "ropemacs" "rope-")
    ;; Initialize Python Mode
    (autoload 'python-mode "python-mode.el" "Python mode." t)
    (setq auto-mode-alist (append '(("/*.\.py$" . python-mode)) auto-mode-alist))
    ;; Initialize PHP Mode
    (autoload 'php-mode "php-mode.el" "Php mode." t)
    (setq auto-mode-alist (append '(("/*.\.php[345]?$" . php-mode)) auto-mode-alist))
    ;; Initialize color theme
    (color-theme-initialize)
    (color-theme-charcoal-black)
    My first problem is the tab completion for yasnippet is not working. For example in a python file when I type cl then <tab> it doesnt insert the class snippet.
    Is there a tutorial on how to use ropemacs. Do I need to open a py file so that the rope menu entry show up then only can I open a project. Is there a project browser in rope.

    To my knowledge, yasnippet does not support symbol completion prior to inserting the appropriate template.
    The following might provide functionality similar to what you're after:
    (defun complete-before-yas-expand ()
    "Complete the symbol at point before expanding with yasnippet."
    (interactive)
    (let ((yrd yas/root-directory)
    completions)
    (while yrd
    (when (eq (car (file-attributes
    (expand-file-name (symbol-name major-mode)
    (expand-file-name "text-mode"
    (car yrd)))))
    t)
    (mapc (lambda (file) (unless (or (string-match "^\\." file)
    (member file completions))
    (setq completions (cons file completions))))
    (directory-files
    (expand-file-name (symbol-name major-mode)
    (expand-file-name "text-mode"
    (car yrd))))))
    (setq yrd (cdr yrd)))
    (when (symbol-at-point)
    (let* ((comp (try-completion (symbol-name (symbol-at-point)) completions))
    (manycomps (> (length (all-completions (symbol-name (symbol-at-point)) completions)) 1))
    (input (if manycomps (completing-read "Snippet: " completions nil nil comp)
    comp)))
    (when input
    (delete-backward-char (length (symbol-name (symbol-at-point))))
    (insert input))))
    (yas/expand)))
    (define-key yas/minor-mode-map (kbd "<tab>") 'complete-before-yas-expand)
    Unfortunately, I'm not familiar with pymacs or ropemacs.  For project management, CEDET might be a good place to start looking.
    Last edited by chpln (2009-09-27 02:41:46)

  • ZSH tab-completion for pacman

    A long while ago, I found a set of functions for zsh tab-completion for pacman in the Arch mailing list archives. I've improved them recently to make it faster (reading files from /var/lib/pacman instead of calling pacman itself).
    Anyway, you can find my version in the AUR: zsh-pacman
    enjoy!

    shadowhand wrote:
    Been using zsh-pacman for a while, works great, but I'm having some issues with your netcfg completions, stuff like this:
    02:14:14 %] iwconfig [~]
    _arguments:comparguments:208: invalid argument: device[device]
    This is strange i cant reproduce this bug. Any details ?
    Just for informations:
    zsh --version ~
    zsh 4.2.6 (i686-pc-linux-gnu)

  • Unreadable Vim tab completion bar with default colorscheme in console

    Hi,
    I am talking about the bar in Vim that shows up when I type, for example, ":colorscheme <Tab>".
    When using the default color scheme, a dark background and t_Co=8 in the console, this bar is light gray on white, which is barely readable.
    I have this in my .vimrc:
    if &term=~'linux'
    set t_Co=8
    set background=dark
    else
    set t_Co=256
    set background=light
    endif
    Though when in X, I can manually set t_Co=8 and background=dark and the tab completion bar has high contrast, i.e. black on white. (Obviously, for this test I set my terminal background color to black.)
    Last edited by LovelyAlien (2011-11-07 12:17:28)

    frabjous wrote:
    Try opening the file with:
    vim -u NONE filename.tex
    (This will disable your .vimrc and other scripts from loading for the session.)
    ....and see if it's slow then.
    Thanks for the reply.
    Hmm.. Indeed, by doing something like that to the same .tex file, vim is fully responsive.
    So it seems that the .vimrc is 'causing all that. I guess that I should start commenting
    out things in the .vimrc until I see where the problem is...

Maybe you are looking for

  • ABSO - Miscellaneous with transaction type 158

    I create an posting on an new asset (capitalized) with transaction type 158 Gross interco.transf.acquis. prior-yr acq. I fill in: Aquisition value Ord dep Cumulat (By area) Ord dep current year (By area) When I look to the asset AW01N - Asset Explore

  • No destination disk to install time machine back up on to

    My hard drive recently died, so I've bought a new one. I'm trying to install my time machine backup from my external hard drive on to my MacBook Pro. Everything works fine, except when I get to the "Select a Destination" stage, there is no disk to ch

  • Query doesn't work in APD, Error: column store error: fail to create scenario: [340 2048

    Hi Experts, We got a problem here. We have a query ran without any problems in RSRT. But when I try to put it as data sources(infoprovider) in APD. I got following error: column store error: fail to create scenario: [340 2048 We are in BW731006 & ABA

  • Getting an error when trying to use warp stabilizer

    I made a picture slideshow with some videos and I am trying to stabilize my videos. When I click on "Analyze" a red bar comes up saying: "Warp Stabilizer requires clip dimensions to match sequence". Is there an easy was to transfer everything over to

  • Creating users and groups

    Hi all, I have about 100 users and many groups. How can i create users and groups quickly? Appreciate any help