Bug 582993 - guestfish eats words when tab completing case (in)sensitive paths
guestfish eats words when tab completing case (in)sensitive paths
Status: CLOSED UPSTREAM
Product: Virtualization Tools
Classification: Community
Component: libguestfs (Show other bugs)
unspecified
All Linux
high Severity high
: ---
: ---
Assigned To: Richard W.M. Jones
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2010-04-16 07:19 EDT by Jinxin Zheng
Modified: 2010-06-03 04:49 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2010-05-25 09:04:59 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Jinxin Zheng 2010-04-16 07:19:45 EDT
Description of problem:
in guestfish mounted a guest image. when two files whose path has the prefixes differ only in their case, trying to tab-complete by their prefix in common would cause the path to be eaten.

Version-Release number of selected component (if applicable):
><fs> version
major: 1
minor: 2
release: 2
extra: 


How reproducible:
always

Steps to Reproduce:
1. launch guestfish, mount a guest image.
2. let's say we have two files: abc and ABC in root filesystem.
><fs> ls /
abc  ABC 
3. do the following
><fs> ls /ab<tab>
  
Actual results:
step 3 leaves us with
><fs> ls /

Expected results:
the prefix word we typed in should stay not touched after we press the <tab> key as the file actually exists.

Additional info:
I came across this issue by tabbing the /dev path.
><fs> ls /dev/<tab>
/dev/mapper               /dev/vda1                 /dev/VolGroup00           /dev/VolGroup00/LogVol01  
/dev/vda                  /dev/vda2                 /dev/VolGroup00/LogVol00  
><fs> ls /dev/v<tab>
><fs> ls /dev/
Comment 1 Richard W.M. Jones 2010-05-25 07:59:19 EDT
Easy to reproduce this, and it's not specific to NTFS, but happens
also on ext3 filesystems.

$ guestfish -N fs:ext3 -m /dev/sda1
><fs> touch /ABC
><fs> touch /abc
><fs> ll /a<tab>

results in the 'a' character disappearing.
Comment 2 Richard W.M. Jones 2010-05-25 09:04:59 EDT
I've pushed the following commit upstream:
http://git.annexia.org/?p=libguestfs.git;a=commitdiff;h=21bd2db7cf259a17cc3922409937b849e4b83c0f

Testing this is complicated.  You need to look at
all combinations of:

(A) No ~/.inputrc file

(B) ~/.inputrc file containing
  set completion-ignore-case on

(C) ~/.inputrc file containing
  set completion-ignore-case off

and

(1) A filesystem containing files /ABC and /abc

(2) A filesystem containing just /ABC

and

(i) Tab-completing /a<tab>

(ii) Tab-completing /A<tab>

However this does work for me, and the default behaviour
(without ~/.inputrc) feels more intuitive particularly on
Windows guests.
Comment 3 Jinxin Zheng 2010-05-25 21:55:59 EDT
(In reply to comment #2)
> I've pushed the following commit upstream:
> http://git.annexia.org/?p=libguestfs.git;a=commitdiff;h=21bd2db7cf259a17cc3922409937b849e4b83c0f
> 
> Testing this is complicated.  You need to look at
> all combinations of:
> 
> (A) No ~/.inputrc file
> 
> (B) ~/.inputrc file containing
>   set completion-ignore-case on
> 
> (C) ~/.inputrc file containing
>   set completion-ignore-case off
> 
> and
> 
> (1) A filesystem containing files /ABC and /abc
> 
> (2) A filesystem containing just /ABC
> 
> and
> 
> (i) Tab-completing /a<tab>
> 
> (ii) Tab-completing /A<tab>
I tested your change following your suggestion. it looks good to me.
setting completion-ignore-case on/off effectively changes the fish's behaviour as supposed to.

> 
> However this does work for me, and the default behaviour
> (without ~/.inputrc) feels more intuitive particularly on
> Windows guests.    
Thanks
Comment 4 Fedora Update System 2010-06-02 17:12:41 EDT
libguestfs-1.2.9-1.el5 has been submitted as an update for Fedora EPEL 5.
http://admin.fedoraproject.org/updates/libguestfs-1.2.9-1.el5
Comment 5 Fedora Update System 2010-06-02 17:26:27 EDT
libguestfs-1.2.9-1.fc13 has been submitted as an update for Fedora 13.
http://admin.fedoraproject.org/updates/libguestfs-1.2.9-1.fc13
Comment 6 Fedora Update System 2010-06-03 04:49:10 EDT
libguestfs-1.2.9-1.el5.1 has been submitted as an update for Fedora EPEL 5.
http://admin.fedoraproject.org/updates/libguestfs-1.2.9-1.el5.1

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