prompt-toolkit / prompt-toolkit/python-prompt-toolkit

PathCompleter does not append `/` to the end of directory

Open
#1,864 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
10.6k
Forks
815
PR merge metrics
No merged PRs in 30d

Description

Zsh autocompletion has the ability to append / to the end of directory with the Tab key, which is super handy.

image

I wonder whether PathCompleter also has this feature or is it just because I set something wrong?

class prompt_toolkit.completion.PathCompleter(only_directories: bool = False, get_paths: Callable[[], list[str]] | None = None, file_filter: Callable[[str], bool] | None = None, min_input_len: int = 0, expanduser: bool = False)

    Complete for Path variables.

    Parameters:

            get_paths – Callable which returns a list of directories to look into when the user enters a relative path.

            file_filter – Callable which takes a filename and returns whether this file should show up in the completion. None when no filtering has to be done.

            min_input_len – Don’t do autocompletion when the input string is shorter.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the prompt_toolkit.completion.PathCompleter entry point and compare its documented behavior with the directory completion shown in the issue. Determine whether completing a directory should append /, then verify that directory and file completion still behave correctly.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.