Skip to content

Honor empty PATH entries in executable completion - #2132

Open
FanWu-ai wants to merge 1 commit into
prompt-toolkit:mainfrom
FanWu-ai:fix-empty-executable-path-20261011
Open

FanWu-ai wants to merge 1 commit into
prompt-toolkit:mainfrom
FanWu-ai:fix-empty-executable-path-20261011

Conversation

@FanWu-ai

Copy link
Copy Markdown

An empty component in PATH represents the current directory, but ExecutableCompleter handed it to os.path.isdir as an empty string. Local executable suggestions disappeared for empty PATH values and leading, trailing, or doubled separators.

Normalize those explicit empty entries to os.curdir, while retaining the previous behavior when PATH is absent. Add tests using real temporary executable files for the four affected cases and six compatibility controls.

Validation on Linux / Python 3.12.14: all 166 tests pass; four new cases fail against the original source. Ruff, formatting, typos, all three configured strict-mypy targets, all pre-commit hooks, sdist/wheel builds, and git diff --check pass. Hosted CI will be reported separately.

AI assistance was used to prepare the implementation and regression tests.

@FanWu-ai
FanWu-ai marked this pull request as ready for review October 10, 2026 21:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant