Skip to content

consult-prompt UI #130

@leungbk

Description

@leungbk

As discussed in the wishlist, consult-prompt would offer a list of all prompts, including eshell, comint, and possibly more. I'll try to implement this within the next week or so, but before I start, I want to clarify what the UI should be like.

Helm has separate commands for 1) selecting a prompt from all (say) comint buffers and 2) selecting a prompt from only the current comint buffer. Do we want separate commands here as well?

Consult also has [space-bar-]narrowing functionality so you can easily narrow to comints only etc.

Numerous major modes are derived from comint, so filtering by comint alone would lead to shell-mode buffers getting mixed in with inf-ruby and inferior-python buffers, which isn't always what I would want.

An alternative is to allow space-bar-filtering by major mode. If multiple major modes start with the same letter, we'd have to make a defcustom for the user to choose major mode gets that letter.

We'd additionally need something like

(defcustom consult-prompt-types
  '((eshell-mode . eshell-next-prompt)
    (shell-mode  . comint-next-prompt)
    ;; (haskell-mode . haskell-interactive-mode-prompt-next)
    )
  "Association list mapping major modes to next-prompt functions.")

to let us acquire all the prompts. The user would specify the major mode and a function to navigate to the next prompt. At each prompt, we'd extract the first line of input (not sure if there's a robust way of capturing more lines of input at a given prompt). Does this sound reasonable?

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions