Add regression tests for shell buffer selection ordering#344
Open
timvisher-dd wants to merge 1 commit intoxenodium:mainfrom
Open
Add regression tests for shell buffer selection ordering#344timvisher-dd wants to merge 1 commit intoxenodium:mainfrom
timvisher-dd wants to merge 1 commit intoxenodium:mainfrom
Conversation
Validate that agent-shell-buffers and agent-shell-project-buffers reflect (buffer-list) ordering correctly: switch-to-buffer and select-window promote, with-current-buffer does not, bury-buffer demotes, and project filtering preserves order. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I thought I'd hit a bug where
C-u C-c Ato create a new shell followed by navigating away andC-c Awould route to the older shell instead of the new one. After investigating(buffer-list)ordering empirically withemacs --batch -Qand tracing the code paths, we proved that the current(buffer-list)-based ordering inagent-shell-buffersworks correctly for this scenario:select-window (display-buffer ...)(the path used byagent-shell--display-buffer) does promote the buffer.These tests document and lock down the actual ordering behavior as regression protection:
switch-to-bufferandselect-windowpromote a shell to the frontwith-current-buffer(used byagent-shell--handle) does not promotebury-bufferdemotes a shell to the endagent-shell-project-buffersfilters by CWD and preserves orderingChecklist
I've filed a feature request/discussion for a new feature.N/A since this just tests documented behavior.M-x checkdocandM-x byte-compile-file.