Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 137890 - bash-completion cannot complete `perldoc` properly
Summary: bash-completion cannot complete `perldoc` properly
Status: RESOLVED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Shell Tools project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-06-24 15:58 UTC by Alex Efros
Modified: 2008-12-06 13:03 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Efros 2006-06-24 15:58:17 UTC
Like some other bugs about bash-completion, this one also about aliases/functions.
I've this in ~/.bashrc:
---cut---
[[ -f /etc/profile.d/bash-completion ]] && source /etc/profile.d/bash-completion
function man()  { vim -c "Man $1 $2"; }
---cut---
After typing `perldoc <TAB>` bash hangs because it execute vim instead of man.
To solve this line 5061 of /etc/bash_completion should be patched to execute
... PAGER=cat command man perl ...
instead of
... PAGER=cat man perl ...

I don't know is it better to report this upstream of fix in gentoo-specific patch.
Comment 1 Mike Kelly (RETIRED) gentoo-dev 2007-01-12 04:41:19 UTC
My suggestion would be to improve upon your man() function, since I think it could cause problems for other things, and because I don't think it's practical to prefix every call to everything in the bash completion scripts with "command" or "builtin".

For example:

man() {
  if [[ -t 1 ]] ; then
    vim -c "Man $1 $2"
  else
    man "${@}"
  fi
}

The [[ -t 1 ]] test means "If stdout is a real terminal." So, if man is called in a pipe, it will call the real man command instead.
Comment 2 Santiago M. Mola (RETIRED) gentoo-dev 2008-12-06 13:03:46 UTC
Alex, if you're still interested in getting this fixed, report it to upstream at http://bash-completion.alioth.debian.org/.

They may want to use 'command' and 'builtin', but we won't add a patch for it if it's not included in the official release.

Thanks for reporting and sorry for the delay in response.