Skip to content

Add prompt segment for current history mode: global vs. per-directory #2384

@cohml

Description

@cohml

The per-directory-history zsh plugin allows users to toggle between directory-specific command histories and overall command histories. This allows for much more rapid and effective history searching. It's awesome.

However, it is kind of annoying to have to manually check my history to deduce which mode I'm in. E.g. history | wc -l --> huge number indicates "global history mode", while a smaller number indicates per-directory history mode. Note that simply scrolling through the last few commands is not always clear, as these may be generic, e.g., ls -l.

In the P10K spirit of an info-packed prompt, it would be so useful to add a prompt element which concisely shows which mode your history is in. For example:

~/some_dir [G]    # global history mode
~/some_dir [D]    # per-directory history mode

From a quick skim of your source code, it seems like the POWERLEVEL9K_*_PROMPT_ELEMENTS variables may be the most sensible place to set this. But maybe there's a better way.

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