Alt arrow combination on mac inside of agent chat controls browser instead of (text)cursor position

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

After using the built-in browser and then switching back to an Agent chat, it seems like some of my keyboard input are still being picked up by the browser instead of the chat.

The weird part is that the chat input looks focused. I can see the text cursor in the message field and type normally, but certain shortcuts still control the browser and move focus over to the browser so I can’t even continue typing and instead have to move my mouse back to the Agent chat.

The easiest example is Alt + Left / Alt + Right. I use those shortcuts to move the text cursor word by word, but instead the browser goes back or forward a page.

I also noticed the same thing with Alt + Up / Alt + Down. Those seem to act on the browser page as well instead of the chat input.

So basically:

  1. Use the built-in browser.
  2. Switch to an Agent chat.
  3. Start typing in the chat input.
  4. Press an Alt + Arrow shortcut.

The browser reacts to it, even though my cursor was focused on the chat.

I’m not sure if other people are running into this with different key combinations too, but Alt + Arrow is where I notice it consistently.

I asked Opus 5.5 (medium) and the reponse I got seemed logical and moves the initial first thought of it just being my own personal hotkey settings, hence why I am writing this report.

Here’s the Agent response:

I found the cause, and it can’t be fixed with a keybinding when condition. Cursor’s built-in browser catches Alt+Left and Alt+Right in Electron’s main process, before the workbench keybinding system ever sees them.

The code is in /Applications/Cursor.app/Contents/Resources/app/out/main.js. Each browser view registers a before-input-event listener, which runs on every key press while the browser has native keyboard focus. That listener checks the key against a fixed table and calls preventDefault() on a match. The relevant part of the table:

else if (s && !n && !r)        // alt only, no cmd, no shift
  switch (i) {
    case "arrowleft":  a = "navigate-back";    break;
    case "arrowright": a = "navigate-forward"; break;
  }

This has no when clause and doesn’t show up in the Keyboard Shortcuts editor. Your keybindings.json has no browser entries either, and the workbench commands cursor.browserView.goBack/goForward have no key bound to them. Nothing you add to keybindings.json can override it.

The real bug is about focus. The listener only fires when the operating system still gives keyboard focus to the browser’s native view, even though the chat input looks focused. The browser is a separate native view on top of the window. When you click into the chat after using the browser, or after an agent drives it, native focus doesn’t always return to the main window. That’s also why Alt+Up and Alt+Down act on the browser page: they aren’t in that table, but they still reach the browser. Cursor has its own way to hand focus back: pressing Cmd+I while the browser is focused calls parentWindow.webContents.focus().

Steps to Reproduce

1 - Open the built-in browser and load any page. Click inside it (or move focus to the browser)
2 - Click into the Agent chat input and type some text.
3 - Press Alt+Left to move back one word.

Expected Behavior

The text cursor moves back one word in the chat input.

Operating System

MacOS

Version Information

Cursor 3.22.7
macOS 26.5.1

Does this stop you from using Cursor

No - Cursor works, but with this issue

Hey @TruFriendsNeverDie, thanks for the report!

This is a known issue we’re already tracking. The built-in browser can keep hold of keyboard focus even after you click back into the chat, so Option+Arrow ends up going to the page instead of your text. I’ve added your report to it.

In the meantime, closing the browser tab and opening it again should make Option+Arrow move by word in the chat again.

One quick check that would help us: does it happen for you after picking a URL from the browser’s address bar suggestions?

  1. Open the built-in browser and load any page.
  2. Click the address bar, type a few letters, and pick a URL from the suggestion list.
  3. Click into the Agent chat input and type a sentence.
  4. Press Option+Left.

Does the browser go back a page at step 4? And does it also happen if you skip step 2 and only click inside the page?

Thank you for your reply!

To answer your questions:

Your suggested workaround works but it greatly disturbs the dynamics of my use, it is often handy to be able to see the content of the browser while typing, and in some projects you want to retain the exact state of the browser so completely closing it just makes everything worse.

Without thinking I was about to say “No, the bug appears at any interaction.” But after trying out your steps against a few other operations in the browser I noticed that this issue indeed appears after the selection of an URL suggestion.

But… That’s not all. The bug appears in all text related fields. Say that I am done typing inside an element inside a browser page and then decide to go to my Agent chat, that also triggers the bug and from then on the browser can be considered “infected”, meaning that while that browser tab is opened, any Agent chat will control the browser instead of the chat’s text.

My suggestion is that it happens at all interactions where my cursor is focused in or on the browser.

And to finish answering your question:

Yes on step 4 my browser does indeed go back, if I skip step 2 it doesn’t trigger the bug, but on any following interaction inside the browser that needs any sort typing “infects” the browser.

In no way or shape is this a complaint (btw), I love Cursor, great product!

Best Regards