Re: bash complete.c

2014-12-26 Thread Bob Proulx
Vincent Leduc wrote:
> sh-3.2# ssh localhost bash -i 2>/dev/null
> root@localhost's password:
> [tab][tab][enter]
> Display all 1797 possibilities? (y or n)[enter]

Although I can reproduce this in bash 4.2 it is not reproducible for
me in bash 4.3.  I assume that it was improved there.

One problem in your example is that your bash does not have a tty
attached to it.  Add -t to ssh and you will then get a tty and you
won't need to redirect 2>/dev/null anymore.

  ssh -t localhost bash

Bob



Re: bash complete.c

2014-12-26 Thread Vincent Leduc
Another way to do it.
 printf "\x9\x9sssh \$ENid" | ssh localhost bash -i
Regards.

  De : Vincent Leduc 
 À : "bug-bash@gnu.org"  
 Envoyé le : Vendredi 26 décembre 2014 15h08
 Objet : bash complete.c
   
Hi,

Dont know if it's the right place to post, just saw this threw bash -i. 

# grep "Display all" lib/readline/complete.c
  fprintf (rl_outstream, "Display all %d possibilities? (y or n)", len);

sh-3.2# ssh localhost bash -i 2>/dev/null
root@localhost's password:
[tab][tab][enter]
Display all 1797 possibilities? (y or n)[enter]
$ENsh

bash --version ;
GNU bash, version 3.2.57(1)-release (x86_64-unknown-linux-gnu)
Copyright (C) 2007 Free Software Foundation, Inc.

Regards,
Vincent Leduc.



  

bash complete.c

2014-12-26 Thread Vincent Leduc
Hi,

Dont know if it's the right place to post, just saw this threw bash -i. 

# grep "Display all" lib/readline/complete.c
  fprintf (rl_outstream, "Display all %d possibilities? (y or n)", len);

sh-3.2# ssh localhost bash -i 2>/dev/null
root@localhost's password:
[tab][tab][enter]
Display all 1797 possibilities? (y or n)[enter]
$ENsh

bash --version ;
GNU bash, version 3.2.57(1)-release (x86_64-unknown-linux-gnu)
Copyright (C) 2007 Free Software Foundation, Inc.

Regards,
Vincent Leduc.



Re: tab completion sort by modification time

2014-12-26 Thread Greg Wooledge
On Thu, Dec 25, 2014 at 12:34:08AM -0500, kamaraju kusumanchi wrote:
> I would like to request a new feature in bash.
> 
> When doing a tab completion inside a directory, I would like the files
> to be listed in the order of modification time (similar to ls -rt).

I think there would be a larger general interest if this were expanded
to a shopt that affects the ordering of globs as well.  It's pretty
common for people in #bash to ask for a script that will return the
oldest file (or newest file, or oldest 10 files, etc.) in a directory.
Doing this right now is possible (using [[ $file1 -ot $file2 ]] in a
loop) but awkward, particularly if you want more than one file.