Bug 444466 - scp remote completion removes hostname
scp remote completion removes hostname
Product: Fedora
Classification: Fedora
Component: gvfs (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Tomáš Bžatek
Fedora Extras Quality Assurance
: 448054 448781 (view as bug list)
Depends On:
  Show dependency treegraph
Reported: 2008-04-28 11:15 EDT by Matthew Miller
Modified: 2015-03-03 17:32 EST (History)
15 users (show)

See Also:
Fixed In Version: 1.0.3-10.fc10
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2009-06-15 21:41:44 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Patch against gvfs F-10 branch to fix this and #466883 (4.29 KB, patch)
2009-03-15 17:27 EDT, Todd Zullinger
no flags Details | Diff
Patch against gvfs F-10 branch to fix this and #466883 (take 2) (4.97 KB, patch)
2009-03-15 19:29 EDT, Todd Zullinger
no flags Details | Diff

External Trackers
Tracker ID Priority Status Summary Last Updated
GNOME Desktop 523732 None None None Never

  None (edit)
Description Matthew Miller 2008-04-28 11:15:59 EDT
I'm using a ssh key, so tab completion should magically work with remote files
with scp. But when I type something like 

scp remotehost:/home/mattdm/p[tab]

it gets remapped to

scp /home/mattdm/public_html/

without the remote hostname and : (regardless of whether public_html exists on
the local system). It's clearly getting the path right, but for some reason, the
hostname gets eaten.

This is with bash-completion-20060301-10.noarch, and I'm fairly certain that
this wasn't a problem a year or so ago, so I'm not sure exactly what change
caused this to happen.
Comment 1 Ville Skyttä 2008-04-28 12:27:01 EDT
I use commands like that all the time and they work for me fine on F-8, also
with 20060301-10 (I have no F-9/Rawhide box to test with at the moment).  Could
you post the console output of:

$ set -x
$ scp remotehost:/home/mattdm/p[TAB]

Comment 2 Matthew Miller 2008-04-28 13:10:36 EDT

There's some conflicts with 'p[tab]' so this is with 'pub[tab]'....

$ scp remotehost:/home/mattdm/pub+ local cur userhost path
+ local 'IFS=
+ cur=remotehost:/home/mattdm/pub
+ _expand
+ '[' remotehost:/home/mattdm/pub '!=' remotehost:/home/mattdm/pub ']'
+ [[ remotehost:/home/mattdm/pub == \~*/* ]]
+ [[ remotehost:/home/mattdm/pub == \~* ]]
+ [[ remotehost:/home/mattdm/pub == *:* ]]
+ cur=remotehost:/home/mattdm/pub
+ userhost=remotehost
+ path=/home/mattdm/pub
+ path=/home/mattdm/pub
+ '[' -z /home/mattdm/pub ']'
+ COMPREPLY=($( ssh -o 'Batchmode yes' $userhost                              
command ls -aF1d "$path*" 2>/dev/null |                         s
++ sed -e 's/[][(){}<>",:;^&!$&=?`|\ ]/\\\\\\&/g' -e 's/'\''/\\\\\\&/g' -e
's/[*@|=]$//g' -e 's/[^\/]$/& /g'
++ ssh -o 'Batchmode yes' remotehost command ls -aF1d '/home/mattdm/pub*'
+ return 0

Comment 3 Yanko Kaneti 2008-05-04 18:41:15 EDT
This is broken by the completion gvfs installs.
Comment 4 Ville Skyttä 2008-05-05 13:59:18 EDT
Thanks for the info, reassigning.
Comment 5 Ville Skyttä 2008-05-05 14:00:50 EDT
*** Bug 444469 has been marked as a duplicate of this bug. ***
Comment 6 Matthew Miller 2008-05-05 14:08:42 EDT
Yes, confirming that removing gvfs solves the problem.
Comment 7 Bug Zapper 2008-05-14 06:18:36 EDT
Changing version to '9' as part of upcoming Fedora 9 GA.
More information and reason for this action is here:
Comment 8 Ville Skyttä 2008-05-23 08:54:26 EDT
Bumping priority/severity, the breakage is affecting quite a few people.
Comment 9 Ville Skyttä 2008-05-23 08:54:51 EDT
*** Bug 448054 has been marked as a duplicate of this bug. ***
Comment 10 Ville Skyttä 2008-05-29 01:20:16 EDT
*** Bug 448781 has been marked as a duplicate of this bug. ***
Comment 11 Richard Guest 2008-06-17 23:09:18 EDT
+1 for broken and *really* annoying...

Using gvfs-0.2.3-11.fc9 and bash-completion-20060301-10.noarch

Is there a fix in the pipeline?
Comment 12 Dan Siemon 2008-06-28 16:49:04 EDT
For a quick fix that doesn't involve removing gvfs just add a line containing
"return" to the top of /etc/profile.d/gvfs-bash-completion.sh.
Comment 13 Ville Skyttä 2008-11-13 14:51:23 EST
Any news on this one?
Comment 14 Todd Zullinger 2008-12-12 18:55:59 EST
It definitely seems that gvfs should be escaping ":" locally if it needs this, rather than forcing all other bash completion consumers to work around this.  I know upstream git folks dealt with it.¹

Is there a bug (Fedora or upstream) that details just why gvfs needs to strip
":" and any reasons why it can't do so in a more local way?  (And I don't mean the bash FAQ that's listed in the gvfs completion script. :)

I'd also be tempted to consider installing the gvfs bash completion via
/etc/profile.d instead of /etc/bash_completion.d a bug.  If the ":" hack was
removed or done locally, there wouldn't be any need for the completion script
to live in /etc/profile.d.

¹ See http://repo.or.cz/w/git.git?a=commitdiff;h=db8a9ff03831a26aa8bfad8bb026b90739d684ec for the work-around that they had to apply.
Comment 15 Todd Zullinger 2008-12-21 12:17:31 EST
Can the gvfs maintainers point out exactly what gvfs usage breaks when COMP_WORDBREAKS contains a ":"?  Is it only command line usage that is affected?  And if so, are there more gvfs command line users than there are users of the various other bash completion types that are broken by gvfs' global adjustment of COMP_WORDBREAKS?

If we knew what was broken for gvfs, perhaps someone could propose a patch that didn't break other bash completion uses.
Comment 16 Matthias Clasen 2009-01-06 11:35:29 EST
Should probably CC davidz, how did the bash completion support and cares about this...
Comment 17 David Zeuthen 2009-01-06 12:31:34 EST
Yeah, this is a bug in GVfs. I'm not sure how to really fix it; suggestions welcome in the upstream bug for this

Comment 18 Todd Zullinger 2009-03-15 17:25:14 EDT
Yay, Alex L fixed this upstream.  Can we cherry-pick the simple change and get it into some updated packages for F-9/F-10?  I'll attach such a patch for F-10.  If that's agreeable, I'd be happy to do the same for F-9 and get things queued up so when the next gvfs update is ready we can fix this annoyance.  (As a bonus, I also fixed #466883 too.)
Comment 19 Todd Zullinger 2009-03-15 17:27:16 EDT
Created attachment 335278 [details]
Patch against gvfs F-10 branch to fix this and #466883
Comment 20 Ville Skyttä 2009-03-15 17:44:23 EDT
Hmm, I don't see anything related to COMP_WORDBREAKS in the patch, just a removal of a check whether the shell is bash or not.  Did I miss something?
Comment 21 Todd Zullinger 2009-03-15 19:29:15 EDT
Created attachment 335281 [details]
Patch against gvfs F-10 branch to fix this and #466883 (take 2)

Gah, sorry Ville.  I managed to attach an incomplete patch.  Let's try this again...
Comment 22 Bug Zapper 2009-06-09 20:29:38 EDT
This message is a reminder that Fedora 9 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 9.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '9'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 9's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 9 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
Comment 23 Todd Zullinger 2009-06-09 23:25:28 EDT
This is still a problem in F-10.  I'd be happy to update and apply the patch I attached in comment #21 and coordinate an update with Tomas.  If that's agreeable, I'll ask for commit privs in the pkgdb.
Comment 24 Fedora Update System 2009-06-12 10:51:15 EDT
gvfs-1.0.3-10.fc10 has been submitted as an update for Fedora 10.
Comment 25 Fedora Update System 2009-06-15 21:41:31 EDT
gvfs-1.0.3-10.fc10 has been pushed to the Fedora 10 stable repository.  If problems still persist, please make note of it in this bug report.

Note You need to log in before you can comment on or make changes to this bug.