[Bug 1040358] Re: please make bash-completion do nothing in non-interactive shells

Peter Cordes peter at cordes.ca
Sun Nov 30 02:43:55 UTC 2014


I think rsync over ssh passes the command to be run through ssh
directly, rather than feeding it to an interactive shell on the remote
side.

 If you run a shell script, bash doesn't even source your .bashrc, so
no, programmable completion isn't even loaded when you run a non-
interactive shell.

 Other than checking if it's running on a terminal (reading commands
from a terminal), I don't think there's any way for bash to know that an
rsync client is on the other end, rather than e.g. a gnome-terminal
window passing keystrokes.  If you're doing something that feeds input
to bash through a terminal, it's going to have all its normal
interactive stuff enabled.

 Please put
date >> /tmp/home.bashrc.log
  in your ~/.bashrc or something, and give an example we can use as a test-case where .bashrc is loaded but shouldn't be.  Or some other kind of testcase to demonstrate that bash-completion stuff is loading in a non-interactive shell.


** Changed in: bash-completion (Ubuntu)
       Status: New => Invalid

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to bash-completion in Ubuntu.
https://bugs.launchpad.net/bugs/1040358

Title:
  please make bash-completion do nothing in non-interactive shells

Status in bash-completion package in Ubuntu:
  Invalid

Bug description:
  A wishlist item: bash_completion is only sensible in interactive
  shells. Using it in non-interactive shells slows down startup and
  makes it possible for a chatty completion (something which echoes
  output) to break things like rsync. Would make things more robust.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/bash-completion/+bug/1040358/+subscriptions



More information about the foundations-bugs mailing list