Skip to content

fix: keep terminal multiline bindings buffer-local#385

Merged
tninja merged 1 commit into
tninja:mainfrom
Silex:fix/terminal-multiline-bindings-buffer-local
Jun 12, 2026
Merged

fix: keep terminal multiline bindings buffer-local#385
tninja merged 1 commit into
tninja:mainfrom
Silex:fix/terminal-multiline-bindings-buffer-local

Conversation

@Silex

@Silex Silex commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Problem

ai-code-backends-infra--configure-session-buffer used local-set-key, which mutates the buffer's local keymap. Terminal buffers (eat/vterm) share their major-mode keymap as the local map, so binding S-<return> / C-<return> / C-<escape> in one session buffer leaked those bindings into every other buffer of the same mode.

Fix

  • Install a buffer-local copy-keymap of the current local map before defining any keys, so bindings stay confined to the session buffer.
  • When no multiline sequence is configured, remove stale multiline bindings instead of leaving them around.

Tests

Added an ERT test verifying that configuring one buffer does not leak the multiline bindings into another buffer sharing the same mode map, and that the unconfigured buffer keeps its original bindings.

@tninja tninja left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Thanks for the fix. I reviewed the diff and the keymap change looks good.

The current red unit-tests / ert check is not caused by this PR. I reproduced the same ai-code-test-session-checkpoint-sends-fixed-checkpoint-prompt failure on origin/main, so it is a pre-existing baseline issue unrelated to the multiline keymap changes here. I will fix that CI failure independently.

@tninja tninja merged commit ac6509f into tninja:main Jun 12, 2026
1 of 2 checks passed
@Silex Silex deleted the fix/terminal-multiline-bindings-buffer-local branch June 12, 2026 19:32
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