Skip to content

cdable vars completion, not working while CDPATH is set. #1506

@blankyblank

Description

@blankyblank

Describe the bug

Recently tab completion stopped working for cdable_vars. It won't suggest any of the directories. I eventually realized after trying to track down the cause, it only happens if CDPATH is also set in my bashrc.

To reproduce

  1. have CDPATH set in bashrc.
  2. have cdable_vars set in bashrc (order doesn't matter)
  3. type cd and the beginning of a variable name.

Expected behavior

What I expected, and what happened before. Tab completion would work like normal for cdable variables.

Versions (please complete the following information)

  • operating system: Arch linux (rolling release)
  • bash version: 5.3.3(1)-release
  • bash-completion version: 2

Additional context

I installed the git version of bash-completion trying to diagnose if it was just the normal version in arch or not. It has the same issue. I'm not sure if this is being caused by a recent change to how bash is processing arrays. Or if it's something else. It started a few days ago. I was actually using artix, when I noticed it happened. And I moved from artix over to arch. Where it continued happeneing. Last night I finally tried to track down the cause, which is when I found that as long as CDPATH is set in the bashrc it won't work.

Debug trace

tab-trace.txt

with the -v flag

tab-trace-v.txt

I noticed it only goes through the whole thing the first time I try. in the same session it will only put out this after.

tab-trace-v-secont.txt

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions