[BusyBox 0000648]: Patch for busybox shell (tab completion)

bugs at busybox.net bugs at busybox.net
Mon Feb 20 20:08:10 UTC 2006


The following issue has been CLOSED 
====================================================================== 
http://busybox.net/bugs/view.php?id=648 
====================================================================== 
Reported By:                sw
Assigned To:                BusyBox
====================================================================== 
Project:                    BusyBox
Issue ID:                   648
Category:                   New Features
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     closed
Resolution:                 fixed
Fixed in Version:           
====================================================================== 
Date Submitted:             01-18-2006 13:51 PST
Last Modified:              02-20-2006 12:08 PST
====================================================================== 
Summary:                    Patch for busybox shell (tab completion)
Description: 
Hello,

this patch improves tab completion for the shell by making it more
compatible
with bash's behaviour. Without patch, tab completion for . and .. does
not
work as expected. The original code was introduced with SVN revision
2905.

The patch also reduces the busybox size by a few bytes  :-) 

Regards
Stefan

====================================================================== 

---------------------------------------------------------------------- 
 vodz - 01-19-06 01:05  
---------------------------------------------------------------------- 
> Without patch, tab completion for . and .. does not
work as expected.

Hmm. For "." my cmdedit works as bash 2.05b.0(1)-release
For ".." you may be right. 

---------------------------------------------------------------------- 
 vodz - 01-19-06 01:11  
---------------------------------------------------------------------- 
Also.
If current directory have file like "..file", my cmdedit works like bash.
For make bash-like tab completion require add code in found you the
place:
if found "../" without other "..any_matches" add '/', else do not add
'/'.
I think, best if do not change to cmdedit. Bash have bloat features for
busybox. 

---------------------------------------------------------------------- 
 sw - 01-19-06 11:33  
---------------------------------------------------------------------- 
At least bash 2.05b.0(1) and bash 3.00.16(1) differ.

Testenvironment is this hierarchy of files and directories:
tabdemo/
tabdemo/dir1
tabdemo/.dir2
tabdemo/file1
tabdemo/..file3
tabdemo/..dir3
tabdemo/.file2

-------------------------

Feature 1:

Here is the output from the new bash:
user at linux:/tabdemo$ ls <tab>
dir1/    .dir2/   ..dir3/  file1    .file2   ..file3

Note that showing entries with leading dot is a bash option.

user at linux:/tabdemo$ ls .<tab>
./       ../      .dir2/   ..dir3/  .file2   ..file3

Bash marks directories with a trailing slash.

The patched busybox has this output:

root at sinus154:/tabdemo# ls <tab>
dir1/   file1
root at sinus154:/tabdemo# ls .
../       ..dir3/   ..file3   ./        .dir2/    .file2

So the behaviour of the patches busybox is now nearly identical:
the sort order of entries should ignore the trailing slash, so
./ should be the first entry.

-------------------------

Feature 2:

In subdirectory dir1, ls ..<tab> expands to ls ../ (what I expect):
user at linux:/tabdemo/dir1$ ls ../
dir1/    .dir2/   ..dir3/  file1    .file2   ..file3

So does the patched busybox shell.

-------------------------

The unpatched busybox shell does not have feature 1 (trailing / for
directories). It also fails at feature 2 (expand ..<tab> into ../). 

---------------------------------------------------------------------- 
 vodz - 01-25-06 03:55  
---------------------------------------------------------------------- 
Ok. See 13587 revision. Sorting rewtoted - more added code. 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
01-18-06 13:51  sw             New Issue                                    
01-18-06 13:51  sw             Status                   new => assigned     
01-18-06 13:51  sw             Assigned To               => BusyBox         
01-19-06 01:05  vodz           Note Added: 0000948                          
01-19-06 01:11  vodz           Note Added: 0000949                          
01-19-06 11:33  sw             Note Added: 0000956                          
01-25-06 03:55  vodz           Note Added: 0000994                          
01-25-06 04:55  vodz           Status                   assigned => resolved
01-25-06 04:55  vodz           Resolution               open => fixed       
01-25-06 04:55  vodz           Additional Information Updated                   

02-20-06 12:08  landley        Status                   resolved => closed  
======================================================================




More information about the busybox-cvs mailing list