prompt-toolkit / python-prompt-toolkit

Library for building powerful interactive command line applications in Python
https://python-prompt-toolkit.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
9.1k stars 717 forks source link

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

Open m3lab-zzl opened 3 months ago

m3lab-zzl commented 3 months ago

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.