Skip to content

prompt-select-session preserves sorting#313

Merged
xenodium merged 1 commit intoxenodium:mainfrom
catern:main
Feb 23, 2026
Merged

prompt-select-session preserves sorting#313
xenodium merged 1 commit intoxenodium:mainfrom
catern:main

Conversation

@catern
Copy link
Contributor

@catern catern commented Feb 20, 2026

agent-shell--prompt-select-session now has completion table metadata such that it won't be sorted alphabetically by completion frontends which check display-sort-function (such as the default completion frontend), and sets eager-display and eager-update to reflect that it's a small list of candidates on which completion is cheap. (these are new in Emacs 31)

The "Start a new session" candidate is now at the end of the candidate list. It's still the default, so a user can still select it easily by pressing RET, but now they more easily can select the candidates at the start of the candidate list, using whatever methods are specific to their completion frontend.

Checklist

  • I've read the README's Contributing section.
  • I've filed a feature request/discussion for a new feature.
  • My code follows the project style.
  • I've added tests where applicable.
  • I've updated documentation where necessary.
  • [] I've run M-x checkdoc and M-x byte-compile-file.
  • I've reviewed all code in PR myself and will vouch for its quality.

Copy link
Owner

@xenodium xenodium left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR! The Resume session (default: start new): feels more idiomatic. Left a couple of comments.

agent-shell--prompt-select-session now has completion table metadata
such that it won't be sorted alphabetically by completion frontends
which check display-sort-function (such as the default completion
frontend), and sets eager-display and eager-update to reflect that
it's a small list of candidates on which completion is cheap. (these
are new in Emacs 31)

The "Start a new session" candidate is now at the end of the candidate
list.  It's still the default, so a user can still select it easily by
pressing RET, but now they more easily can select the candidates at
the start of the candidate list, using whatever methods are specific
to their completion frontend.
@xenodium xenodium merged commit 492cbb1 into xenodium:main Feb 23, 2026
@xenodium
Copy link
Owner

xenodium commented Feb 23, 2026

Thanks for the changes. Merged.

Heads-up, I may look into further changes. While I like the (default: start new) prompt, moving the "start new" to last means that when selected by default in a vertical completion framework (mine is ivy), the last item is naturally selected (but also scrolled). As a result, I now have a view of the oldest created sessions (and lose view of the most recent ones) by default.

xenodium added a commit that referenced this pull request Feb 23, 2026
@xenodium
Copy link
Owner

Hmmm... feels a little strange for the default option to be the last option.

I've pushed 5ec181e bringing the new shell option back to top, but I'm hoping with the introduction of display-sort-function still remains compatible with your flow.

timvisher-dd pushed a commit to timvisher-dd/agent-shell-plus that referenced this pull request Feb 24, 2026
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.

2 participants