tab-completion of scp removes hostname

Bug #336670 reported by Torsten Bronger
6
Affects Status Importance Assigned to Milestone
bash-completion (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

If I use the auto-completion of bash with TAB, the hostname of the destination path is removed. Thus, I have

scp bob:/windows/T/daten/0_projekte/ACME

then I press TAB and get

scp /windows/T/daten/0_projekte/ACME01/

so the hostname "bob" was wrongly removed.

Revision history for this message
Andreas Olsson (andol) wrote :

What version of bash in which version of Ubuntu?

Andreas Olsson (andol)
Changed in bash:
status: New → Incomplete
Revision history for this message
Torsten Bronger (bronger) wrote :

It's Ubuntu 8.10 desktop, Bash 3.2.39(1)-release.

However, I only experiance this behaviour if I login via ssh or use the text console. Under gnome-terminal, this issue doesn't occur.

My .profile and .bashrc only contain Python- and Nvidia-specific additions. Apart from them, I use vanilla Ubuntu profiles.

Revision history for this message
YoBoY (yoboy-leguesh) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. Please answer these questions:

1- can you detail more precisely a use case, what you want to do, what you espected, what is the result of you actions?
2- your destination path is a local folder? if not how you manage the completion on it? and where is you source file/path ? (i don't use scp)
3- your hostname is your actual machine, a local pc, or a pc on the internet? have you put it in the /etc/hosts file or other file?

I tried to reproduce but can't understand how this is working. Tanks to make a use case i can reproduce with my non technical background.

I also move this bug to the bash-completion package because the scp completion is scripted in /etc/bash_completion and only work if it's loaded.

Revision history for this message
Torsten Bronger (bronger) wrote :

From my lab, I login into my home Ubuntu system in order to copy files with scp to my lab computer. For this, I use PuTTY on Windows to connect to my home machine. I see the Bash prompt.

Then I visit the folder with the files. My lab computer is called "bob". The full URL path I want to copy to is "bob:/windows/". So I enter "scp myfile.dat bob:/win" and press TAB.

After this, I see "scp myfile.dat /windows/". But I expect to see "scp myfile.dat bob:/windows/". So you see, the hostname was erroneously removed by tab completion. But you also see that Bash has successfully connected bob and has seen that there is the root folder "windows/".

As a workaround, I call "bash" immediately after having logged-in. So I call bash in bash. The child bash doesn't exhibit this behaviour for some reason.

Revision history for this message
James Westby (james-w) wrote :

Hi,

Could you please do

  echo $BASH_COMPLETION
  echo $BASH_COMPLETION_DIR

both when it works and when it doesn't work as expected.

Thanks,

James

Revision history for this message
Torsten Bronger (bronger) wrote :

Unfortunately, the output is the same in both cases:

bronger@wilson:~$ echo $BASH_COMPLETION
/etc/bash_completion
bronger@wilson:~$ echo $BASH_COMPLETION_DIR
/etc/bash_completion.d
bronger@wilson:~$ bash
bronger@wilson:~$ echo $BASH_COMPLETION
/etc/bash_completion
bronger@wilson:~$ echo $BASH_COMPLETION_DIR
/etc/bash_completion.d

(I checked whether the completion beheviour was different; it was.)

Revision history for this message
Jerome Reybert (jreybert) wrote :

This bug is being discussed in the red hat bugzilla too:
https://bugzilla.redhat.com/show_bug.cgi?id=444466

It seems to exist a conflict between the scp auto completion and the gvfs one. There are two solutions, waiting for a correction:
 - disable the gvfs autocompletion. For that, just add "return" at the top of the file /etc/bash_completion.d/gvfs-bash-completion.sh
 - remove the gvfs package

For both solution, the behaviour is effective only if I kill X (I don't know how to restart bash_completion).

Revision history for this message
Torsten Bronger (bronger) wrote :

I switched to Jaunty and can't reproduce the problem any more, sorry.

Revision history for this message
James Westby (james-w) wrote :

Hi,

Thanks for updating us on the status. I'm closing the bug as you
can't reproduce it now. Please re-open the bug if it occurs again.

Thanks,

James

Changed in bash-completion (Ubuntu):
status: Incomplete → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.