Skip to content

Custom Editor keybindings are sometimes not applied to the Console at startup #18793

Closed

Description

@kevinushey

System details

RStudio Edition: Desktop and Server
RStudio Version: 2026.10.0 (main)
OS Version: all

Steps to reproduce

  1. Tools > Modify Keyboard Shortcuts, rebind an Editor-scope command (e.g. Remove Word Left) to a new shortcut, Apply.
  2. Reload the browser page (Server) or restart RStudio (Desktop) with no source document open.
  3. Type some text in the Console and press the new shortcut.

Describe the problem in detail

Some of the time the shortcut does nothing in the Console until a source document is opened. The e2e canary console_editor_keybindings.test.ts ("the saved rebinding is applied to the console at startup") flaked this way on desktop-linux in run 34637770965, and its trace shows the client reading keybindings/addins.json and keybindings/rstudio_bindings.json after the reload but never keybindings/editor_bindings.json.

EditorCommandManager only registers its EditorLoadedEvent handler inside the AceEditor.load() callback, and ExternalJavaScriptLoader drains its callbacks one per scheduler tick, so the Console's Ace editor can attach and fire EditorLoadedEvent before the handler exists. When that happens the editor bindings are never loaded for that session until another editor loads.

Describe the behavior you expected

Saved Editor keybindings apply to the Console on every startup, whether or not a source document is open.

Metadata

Metadata

Assignees

Type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions