• tab completion being overenthusiastic

    From Eben King@21:1/5 to All on Sat Sep 7 15:00:02 2024
    Hi. I have bash 5.2.15(1). When I cd into an empty directory, and type "cd <tab><tab>", the shell offers 178 possibilities. If I restrict it to an initial letter and hit <tab> once, I think the spurious offerings are from $HOME. How can I make it not do that and only offer me things I ask for?

    --
    Unfortunately, our Bright Young PFY will no longer be assisting
    with expeditions downtown, as he has been dubbed the
    Telecom Destruction Bunny and banned from taking
    his aura anywhere near anything major. -- Anthony DeBoer on ASR

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Greg Wooledge@21:1/5 to Eben King on Sat Sep 7 15:30:02 2024
    On Sat, Sep 07, 2024 at 08:56:08 -0400, Eben King wrote:
    Hi. I have bash 5.2.15(1). When I cd into an empty directory, and type "cd <tab><tab>", the shell offers 178 possibilities. If I restrict it to an initial letter and hit <tab> once, I think the spurious offerings are from $HOME. How can I make it not do that and only offer me things I ask for?

    Do you perhaps have the CDPATH variable set? That might affect tab
    completion for the cd command.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [email protected]@21:1/5 to Greg Wooledge on Sat Sep 7 15:40:01 2024
    On 9/7/24 09:26, Greg Wooledge wrote:
    On Sat, Sep 07, 2024 at 08:56:08 -0400, Eben King wrote:
    Hi. I have bash 5.2.15(1). When I cd into an empty directory, and type "cd >> <tab><tab>", the shell offers 178 possibilities. If I restrict it to an
    initial letter and hit <tab> once, I think the spurious offerings are from >> $HOME. How can I make it not do that and only offer me things I ask for?

    Do you perhaps have the CDPATH variable set? That might affect tab completion for the cd command.

    eben@cerberus:~$ echo "$CDPATH"
    :~:/

    0
    eben@cerberus:~$ grep CDPATH /etc/profile /etc/profile.d/* ~/.profile ~/.bash_profile
    1
    eben@cerberus:~$

    In fact I do. Good catch. Any idea where it could be set, other than the places I looked?

    --
    GEMINI: Your birthday party will be ruined once again by your explosive flatulence. Your love life will run into trouble when your fiancee hurls
    a javelin through your chest. -- Weird Al, _Your Horoscope for Today_

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [email protected]@21:1/5 to [email protected] on Sat Sep 7 16:00:01 2024
    On 9/7/24 09:37, [email protected] wrote:
    On 9/7/24 09:26, Greg Wooledge wrote:
    On Sat, Sep 07, 2024 at 08:56:08 -0400, Eben King wrote:
    Hi. I have bash 5.2.15(1). When I cd into an empty directory, and
    type "cd <tab><tab>", the shell offers 178 possibilities. If I
    restrict it to an initial letter and hit <tab> once, I think the
    spurious offerings are from $HOME. How can I make it not do that and
    only offer me things I ask for?

    Do you perhaps have the CDPATH variable set? That might affect tab
    completion for the cd command.

    eben@cerberus:~$ echo "$CDPATH" :~:/
    0
    eben@cerberus:~$ grep CDPATH /etc/profile /etc/profile.d/* ~/.profile ~/.bash_profile > 1
    eben@cerberus:~$

    In fact I do. Good catch. Any idea where it could be set, other than
    the places I looked?

    Got it. It was in ~/.bash-vars which was sourced from ~/.bash_profile . Is that a standard thing, or just some "brilliant" idea I had once upon a time?

    --
    Only two things are infinite, the universe and human stupidity,
    and I'm not sure about the former." -- Albert Einstein

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Greg Wooledge@21:1/5 to [email protected] on Sat Sep 7 16:10:01 2024
    On Sat, Sep 07, 2024 at 09:58:32 -0400, [email protected] wrote:
    Got it. It was in ~/.bash-vars which was sourced from ~/.bash_profile . Is that a standard thing, or just some "brilliant" idea I had once upon a time?

    It's not a standard file.

    By the way, there's a trick you can use to find out where shell variables
    are being defined:

    PS4='+ $BASH_SOURCE:$FUNCNAME:$LINENO:' bash -ilxc : 2>&1 | grep CDPATH

    The -il options run an interactive login shell. If you need to check an interactive non-login shell instead, just change the options to -ixc.

    This won't work as root, because PS4 from the environment is suppressed
    for security reasons when running bash as root.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [email protected]@21:1/5 to Greg Wooledge on Sat Sep 7 17:10:01 2024
    On 9/7/24 10:07, Greg Wooledge wrote:
    By the way, there's a trick you can use to find out where shell variables
    are being defined:

    PS4='+ $BASH_SOURCE:$FUNCNAME:$LINENO:' bash -ilxc : 2>&1 | grep CDPATH

    The -il options run an interactive login shell. If you need to check an interactive non-login shell instead, just change the options to -ixc.

    This won't work as root, because PS4 from the environment is suppressed
    for security reasons when running bash as root.

    Excellent, thank you.

    --
    Q: What did one photon say to the other photon?
    A: I'm sick and tired of your interference. -- thebigmike1983 on Fark

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [email protected]@21:1/5 to Greg Wooledge on Sat Sep 7 21:20:02 2024
    On Sat, Sep 07, 2024 at 10:07:00AM -0400, Greg Wooledge wrote:

    [...]

    By the way, there's a trick you can use to find out where shell variables
    are being defined:

    PS4='+ $BASH_SOURCE:$FUNCNAME:$LINENO:' bash -ilxc : 2>&1 | grep CDPATH

    Nifty! Thanks for this one.

    Cheers
    --
    t

    -----BEGIN PGP SIGNATURE-----

    iF0EABECAB0WIQRp53liolZD6iXhAoIFyCz1etHaRgUCZtyl0wAKCRAFyCz1etHa Rr07AJ0RqHUIYnulXxoEo/bMJh+dVtdSawCfTdVDwXdg7gUUhptrxongSDtrqOI=
    =Ap0e
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Wright@21:1/5 to [email protected] on Mon Sep 9 15:50:01 2024
    On Sat 07 Sep 2024 at 09:58:32 (-0400), [email protected] wrote:
    Got it. It was in ~/.bash-vars which was sourced from ~/.bash_profile . Is that a standard thing, or just some "brilliant" idea I had once upon a time?

    If you mean the file itself, you might try stat ~/.bash-vars
    and looking at the Birth date; then you could check out your
    Sent Mail folder and see whether you were discussing anything
    relevant around that time. Other places that might help are
    your browser's history, and the index for debian-user.

    Cheers,
    David.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)