Skip to content

Source Inspector: Shift+Cmd/Ctrl+Click shortcut conflicts with macOS screenshot (should be configurable) #374

Description

@ethan-huo

Problem

The Source Inspector ("Go to source") is triggered by Shift + Cmd (Meta) + Click, which is hardcoded in source-inspector.tsx:

const isShiftHeld = keys.includes('SHIFT')
const isCtrlHeld = keys.includes('CONTROL')
const isMetaHeld = keys.includes('META')
return isShiftHeld && (isCtrlHeld || isMetaHeld)

On macOS, Shift + Cmd + 4 is the system screenshot shortcut (region capture). When you press Shift + Cmd to start a screenshot, the Source Inspector immediately activates and highlights elements under the cursor — the highlight overlay ends up captured in the screenshot.

This is a pretty common workflow conflict since virtually every Mac user uses Shift+Cmd+4 regularly.

Proposed Solution

Make the Source Inspector modifier keys configurable via the Vite plugin options, e.g.:

devtools({
  injectSource: {
    enabled: true,
    modifierKeys: ['Alt', 'Shift'], // default: ['Shift', 'Meta'] or ['Shift', 'Control']
  },
})

The current hardcoded Shift + Meta/Ctrl default is fine, but users should be able to change it to avoid conflicts with OS-level shortcuts.

Environment

  • macOS (Apple Silicon)
  • @tanstack/devtools-vite
  • Affects any Mac user who takes screenshots with Shift+Cmd+4

Activity

  1. github-actions commented on Mar 9, 2026

    @github-actions
    Contributor

    Hi @ethan-huo, thanks for the detailed write-up! The conflict with macOS's Shift+Cmd+4 screenshot shortcut is a clear and well-explained issue, and the proposed configurable modifier keys solution makes a lot of sense.

    Before we can triage this further, could you fill in a few details that are required by our bug report template?

    1. TanStack Devtools version — Which exact version of @tanstack/devtools-vite are you using? (e.g. v0.x.x, not just "latest")
    2. Framework/Library version — Which framework and version are you using? (e.g. React v18.3.1, Vue v3.5.0, etc.)
    3. Minimal Reproducible Example — A CodeSandbox or Stackblitz link would help, though we understand this one is fairly straightforward to reproduce on any Mac.

    Thanks!

  2. bensenescu commented on Mar 11, 2026

    @bensenescu

    Huge +1 on this ^^^^

    I started this PR on it, but couldn't figure out how to reliably trigger the inspector with other hot keys on mac: bensenescu#1

  3. harry-whorlow commented on Mar 19, 2026

    @harry-whorlow
    Collaborator

    @ethan-huo what version are you using? we've pushed out a couple fixes to try address this.

  4. bensenescu commented on Apr 7, 2026

    @bensenescu

    @harry-whorlow

    I'm still seeing this after updating. Here are my versions:

        "@tanstack/react-router-devtools": "^1.166.11",
        "@tanstack/devtools-vite": "^0.6.0",
        "@tanstack/react-devtools": "^0.10.1",
    
    Image
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions