How-to · Cursor for Mac

How to use cursor cmd k inline edit mac: Cmd+K now sends code to Agent

On a Mac, Cmd+K no longer opens a small inline edit box in current Cursor. Select the code, press ⌘K, and Cursor sends those lines to Agent, where you type the change and review the result in a diff view.

Updated Checked against Cursor desktop app on macOS, as documented on 2026-11-0810 minEasy

Developer editing code on a Mac laptop for a cursor cmd k inline edit task
Editing code on a Mac laptop · Image by StockSnap from Pixabay

Quick answer

  • On Mac, Cmd+K now sends the selected code to Agent instead of opening a small inline edit box.
  • Select code, press ⌘K or ⌘L, type your instruction, then press Return.
  • Review every change in the diff view and reject the edits you don't want.
  • Restore Checkpoint reverts files only. It does not delete your chat messages.
  • If ⌘K does something else on your Mac, check the shortcut list with ⌘R then ⌘S.

What you need

  • Cursor desktop app installed on macOS
  • A project open with a file you can safely change
  • Cursor's keyboard shortcut list available with ⌘R then ⌘S if you need to check Cmd+K

How to Send selected code to Cursor Agent with Cmd+K on Mac in Cursor on a Mac

  1. Open the file you want to change

    Open the project in Cursor and open the file that holds the code. Save the file first, so you have a clean copy to compare against after the edit. Keep the file open while you work, since the diff view refers to it.

  2. Select the code

    Select the lines you want Agent to see. Click and drag with the mouse, or hold Shift and press the arrow keys. Select the whole function when the change touches the whole function. A plain cursor position has no selection to send.

    Tip: Select a little more than the change needs, so Agent sees the lines around it.

  3. Press Cmd+K to send the selection to Agent

    ⌘K

    Press ⌘K while the code is selected. Cursor sends the selection to the Agent chat, and the lines appear there as a reference. The docs say ⌘L does the same thing, so use whichever key you remember.

  4. Type your instruction

    Type what should change, in plain words. Say what the code should do after the edit, and name anything that must stay the same. Keep it to one change, so the diff stays easy to read.

  5. Press Return to run it

    Return

    Press Return to send the instruction. Agent starts working on the change. Watch the response in the chat while it runs, and do not edit the selected lines until it finishes.

  6. Stop a response that runs the wrong way

    ⌘⇧⌫

    If Agent heads in the wrong direction, stop it. The keyboard reference lists ⌘⇧⌫ (Cmd+Shift+Backspace) as Cancel generation, and the Stop button halts a task too. Then send a corrected instruction in the same chat.

  7. Read every change in the diff view

    Open the diff view that shows Agent's edits. Read each change against the original. Check that any edit outside your selection is one you actually want. Reject any change you don't want, one edit at a time.

  8. Keep the changes you want

    The docs describe rejecting edits one at a time in the diff view. They do not describe a separate accept button in the current pages. Look at the controls in the diff panel in your version, and leave the good changes in place.

  9. Undo with Restore Checkpoint if the result is wrong

    Hover over an earlier message in the Agent chat. Click Restore Checkpoint in the bottom right corner of that message. Cursor reverts the files to that point. Messages stay in the chat, so you can still read what you asked.

  10. Switch modes with Shift+Tab

    ⇧Tab

    Press Shift+Tab to cycle through Agent, Ask, Plan and Debug. Ask is read-only, so it answers questions and does not edit files. Plan edits only after you approve its plan. Each mode starts a fresh context.

  11. Open the Agent panel with Cmd+I

    ⌘I

    Press ⌘I to open the Agent panel when you want to start a request without selecting code first. You can also use the mode picker in the panel. Keep using the same chat when you are continuing the same change.

  12. Send terminal output to Agent

    ⌘L

    Select the terminal output you want to discuss, then press ⌘L first. Type your question in Agent. A Cursor staff member wrote on the forum that this is the closest replacement for the old Cmd+K terminal habit.

  13. Open the keyboard shortcut list

    Command Palette (⌘⇧P)Keyboard Shortcuts⌘⇧P

    Press ⌘R then ⌘S to open the keyboard shortcut list. You can also press ⌘⇧P, type Keyboard Shortcuts, and choose it. Find the Cmd+K and Cmd+L entries and check what each one is bound to.

  14. Remap Cmd+K if another command takes it

    Change the binding in that list to a key combination you don't use. Cursor says every keybinding can be remapped there. Then press the new key in a code file and confirm that Agent opens with the selection.

If you learned Cursor from an older guide, you may remember a small box that appeared over selected code when you pressed Cmd+K. That box is gone. Cursor's help page says Cmd+K used to open inline edit, and that workflow has been replaced. The replacement is Agent, the chat panel that can edit your files. This page covers the current steps and what each key does now.

Developer editing code on a Mac laptop for a cursor cmd k inline edit task
Editing code on a Mac laptop · Image by StockSnap from Pixabay

What Cmd+K does now on a Mac

Select the code you want to change, then press Cmd+K. Cursor sends the selection to the Agent chat, and the lines you selected appear there as a reference. Type what should change and press Return. Cmd+L does the same job, according to Cursor's inline-edit page. On Windows and Linux the keys are Ctrl+K and Ctrl+L.

Why Cmd+K changed in Cursor

Cursor 3.0 arrived on April 2, 2026. Its changelog calls it the new Cursor interface, and it introduced the Agents Window and Design Mode. In the current interface, Agent handles the edits that the old dialog used to handle. The docs say Cmd+K was replaced, but they do not name the exact release where the old dialog stopped working. Cursor's changelog lists dates, not version numbers, so official pages alone cannot pin the change to one version.

The keys you need on a Mac

Most of the work happens with five keys. ⌘K or ⌘L sends selected code to Agent. ⌘I opens the Agent panel without a selection. Shift+Tab switches between Agent modes. Cmd+Shift+Backspace stops a response that is still running. ⌘R then ⌘S opens the shortcut list, so you can check what each key is bound to.

Shortcuts as listed in Cursor's inline edit and keyboard shortcut docs
Shortcut on MacWhat it does in current Cursor
⌘K or ⌘LSends the selected code to Agent with those lines referenced
⌘IOpens the Agent panel
⇧TabCycles through Agent, Ask, Plan and Debug modes
⌘⇧⌫Cancels a response that is still generating
⌘R then ⌘SOpens the keyboard shortcut list

Cmd+K shows up twice in Cursor's shortcut reference. The list gives it as Toggle Sidepanel under General, and as Add selection to new chat under code selection. Those entries conflict with the help page, which says Cmd+K sends the selection to Agent. Treat the help page as current. If Cmd+K opens the side panel for you, your shortcut is bound differently, and you can change it in the list.

How much code to select before you press Cmd+K

The selection sets the scope of the edit. Select too little and Agent may miss the context it needs. Select too much and the diff gets long and hard to read. A good rule is the smallest block that holds the whole change, plus a few lines around it.

A single line works when the fix is local, such as a wrong comparison operator or a typo in a variable name. A whole function works when the change touches its return value or its branches. A whole file works only when the change needs the full structure. For that last case, say so in the instruction, and check every changed line in the diff.

Worked example: fixing one function with Cmd+K

Say you have a short function that crashes when the input is empty. Select the whole function. Press Cmd+K. In the Agent chat, type: return an empty list when the input is empty, and keep the rest of the logic the same. Press Return. Agent works on the lines you sent and shows its edit in the diff view. Read the change before you keep it, and check that nothing outside the function moved.

The instruction matters more than the key. A clear request gives a small diff. A vague one, such as make this better, gives Agent no target. You may get a large rewrite back, which takes longer to review and is harder to undo cleanly. Ask for one change at a time.

A second example: fixing a SQL query

Suppose a query returns duplicate rows after a join. Select the query text, press Cmd+K, and type: keep one row per order_id, and keep the same columns. Agent sees the lines you selected. Check the new query by reading the join and the grouping. Then run it against a test database before you trust the result.

Keep real customer data out of the chat. A small sample of rows usually shows the same problem. If the query needs production data to reproduce the bug, describe the shape of the data instead of pasting it.

How to write a first instruction that works

  1. Say what the code should do after the change, in one plain sentence.
  2. Name anything that must stay the same, such as the function name or the return type.
  3. Mention the language or framework if the selection is short and unclear.
  4. Ask for one change at a time, then review it before you ask for the next.

Those four habits cover most cases. If the first result misses, send a follow-up in the same chat that names the exact line that is wrong. Agent can then correct that line without touching the rest of the code.

Review the diff and reject unwanted edits

Agent shows its edits in the diff view. The docs say you review each change there and reject the ones you don't want, one at a time. They don't describe a separate accept button in the current pages, so look at the controls in the diff panel in your version. Pay the closest attention to edits outside your selection, since those are the ones that surprise people.

Before you keep anything, run through a short check. Did the function name stay the same? Did the return type change? Did any file outside your selection change? Does the code still run your tests? Each answer should be yes before you move on.

If the whole result is wrong, don't patch it by hand right away. Undo first, then send a sharper instruction. Patching a bad edit can leave you with a mix of your fix and Agent's guess, which is harder to check.

Undo an edit with Restore Checkpoint

Hover over an earlier message in the Agent chat. Click Restore Checkpoint in the bottom right corner of that message. Cursor reverts the files to that point. The docs say this reverts files only and does not remove messages, so the conversation stays visible.

If you want a shorter conversation, fork the chat from an earlier message instead. Forking suits a chat that has become noisy. Restore Checkpoint suits a case where the files are wrong. If you have your own edits in the same file, save a copy first, because the rollback reaches those files too.

Agent, Ask, Plan and Debug modes

Press Shift+Tab to cycle the modes, or use the mode picker. Each mode starts a fresh context, so details from the last mode do not carry over. Pick the mode before you type, since the mode shapes what Agent is allowed to do.

  • Agent reads your code and edits files.
  • Ask is read-only. It answers questions and does not edit anything.
  • Plan proposes a plan and edits after you approve it.
  • Debug works on a problem and can edit files.

Use Ask when you want an explanation first. Switch to Agent once you know exactly what should change. Plan helps when the change spans several parts of the code and you want to check the approach before any file changes.

Send terminal output to Agent

The old Cmd+K habit also covered the terminal. A Cursor staff member wrote on the community forum that the closest replacement is Agent. To work from terminal output, select it and press Cmd+L first, then ask your question. The same post says updating Cursor won't bring the old behavior back.

Terminal output suits error messages well. Select the lines that show the error, send them to Agent, and ask what caused it. Then check the answer against the code before you change anything.

Programmer reviewing code changes on a laptop screen during a cursor cmd k inline edit review
Reviewing code changes before keeping them · Image by Elchinator from Pixabay

When Cmd+K does nothing or does something else

Start with the shortcut list. Press ⌘R then ⌘S, or press ⌘⇧P and search for Keyboard Shortcuts. Look up Cmd+K and Cmd+L there. Cursor says every keybinding can be remapped in that list. Cursor's docs don't give a Cursor > Settings path for shortcuts, so use the Command Palette route rather than guessing a menu.

Also check for a clash with another app. A utility or a system shortcut can claim the same key combination before Cursor sees it. Test the key in a plain text file in Cursor. If it works there, the problem is likely the selection or the file you were in.

Mistakes people make with Cmd+K on a Mac

  • Pressing Cmd+K with nothing selected. Select the code first, so Agent gets the lines you mean.
  • Asking for a rewrite of a whole file when only one function needs to change.
  • Accepting the result without reading the diff view, then finding an unrelated edit later.
  • Expecting Restore Checkpoint to delete chat messages. It only reverts files.
  • Following a tutorial that describes an inline dialog. The current docs describe Agent.
  • Switching modes mid-task and expecting the earlier context to carry over. Each mode starts fresh.

Most of these come from old habits. The fix is the same each time. Select the code, say what you want, and read the diff before you keep anything.

What the official docs confirm and what they don't

The help page and the overview docs agree on the core workflow. Cmd+K sends selected code to Agent, you type the instruction, and you review the edits in the diff view. Cursor's own pages confirm those steps.

Several details are not confirmed. No Mac menu path for shortcuts appears in the docs, so the Command Palette route is the one to use. The docs also don't name the Cursor version that removed the old dialog. Cursor's changelog lists dates, not version numbers.

Cursor 3.0 came out on April 2, 2026 and introduced the Agents Window. The changelog's newest entry is dated Nov 6, 2026, and it doesn't mention Cmd+K. Check which version your install runs before you rely on any single step here.

Apr 2, 2026

Cursor 3.0 release, which introduced the Agents Window

Cursor Changelog: Cursor 3.0 'New Cursor Interface'

Oct 26, 2026

Date of the forum post saying the closest replacement for Cmd+K is Agent

Cursor Community Forum: 'Cmd+K Has Been Retired' thread

Nov 6, 2026

Date of the newest Cursor changelog entry, which does not mention Cmd+K

Cursor Changelog

What to do next

Try the worked example on a small function in a file you can afford to change. Press ⌘K, read the diff, and use Restore Checkpoint once so you know how undo works before you need it. Then open the shortcut list and confirm what ⌘K does on your machine.

Person working at a Mac laptop on a desk, checking a cursor cmd k inline edit result
Checking an edit at a Mac desk · Image by StartupStockPhotos from Pixabay

When an instruction goes wrong, change the instruction before you change the code. A narrower request in the same chat is usually faster than a manual fix on top of a bad edit.

Cursor shortcuts for this on Mac

Cursor keyboard shortcuts on Mac
To do thisPress
Send selected code to Agent⌘K or⌘L
Open the Agent panel⌘I
Cycle Agent, Ask, Plan and Debug modes⇧Tab
Cancel generation⌘⇧⌫
Send selected terminal output to Agent⌘L
Open the keyboard shortcut list⌘R then⌘S
Open the Command Palette⌘⇧P
Toggle Agent layout⌘E

If it does not work

Cmd+K opens the side panel instead of sending code to Agent
The shortcut reference lists Cmd+K as Toggle Sidepanel too. Open the shortcut list with ⌘R then ⌘S, find Cmd+K, and rebind it if it is set to something else.
Agent opens with no code referenced
You probably pressed the key without a selection. Select the lines first, then press ⌘K again. A plain cursor position has nothing to send.
The edit changed code you never selected
Reject that change in the diff view. Then send a narrower instruction that names the function. If the whole result is wrong, use Restore Checkpoint on the message before the edit.
Agent forgets a request you made in another mode
Each mode starts a fresh context. Repeat the important details in the new request, or stay in the same mode for the whole change.
You want the old inline edit dialog back
The current docs do not describe that dialog. A Cursor staff member said updating won't bring it back. Use Agent with a selection instead.
Cmd+K does nothing on your Mac
Check for a clash with another app or a system shortcut, then test the key in a plain text file in Cursor. If it works there, the problem is likely the selection or the file.

Faster with Lazur

Do it faster: ask Lazur while you are in Cursor

Hold ⌥ ⌘ and say what you want. Lazur sees your Cursor window. Lazur draws a circle and a label around the button or menu you need.

  • 1

    Hold ⌥⌘ and talk

  • 2

    Lazur draws a circle and a label around the button or menu you need.

  • 3

    You stay in Cursor. Nothing to copy into a chat window.

Free for 3 days, then $18/month. Download for Mac

You say“Where's the Restore Checkpoint button?”

Lazur · points at itLazur circles the Restore Checkpoint button and labels it on your screen, so you know where to click.

Cursor
ExplorerSearchRestore CheckpointRight hereSource ControlRun

Questions people ask

Does Cmd+K still open an inline edit box in Cursor on Mac?

No. Cursor's help page says Cmd+K used to open inline edit, which has been replaced by its Agent workflow. On a Mac, Cmd+K now sends the selected code to Agent.

What is the difference between Cmd+K and Cmd+L?

The docs say both keys send the selection to Agent with those lines referenced. The forum post names Cmd+L for terminal output, so use whichever key you remember and check the shortcut list if one does something else.

Why does Cmd+K appear twice in Cursor's shortcut reference?

The keyboard reference lists Cmd+K as Toggle Sidepanel and as Add selection to new chat. Those entries conflict with the help page, so treat the help page as current and check your own shortcut list.

Can I get the old inline edit dialog back?

The current docs do not describe that dialog. A Cursor staff member wrote on the forum that updating won't bring it back. Use Agent with the selection for the same kind of change.

Does Restore Checkpoint delete my chat history?

No. Restore Checkpoint reverts files only and does not remove messages. If you want a shorter conversation, fork the chat from an earlier message instead.

Which mode should I use when I only have a question about code?

Use Ask. It is read-only, so it explains code without editing files. Switch to Agent when you know the change you want to make.

Does Cursor use the same keys on Windows?

The docs say Ctrl+K and Ctrl+L do the same job on Windows and Linux. This guide covers the Mac keys, so use the same steps with Ctrl in place of Cmd.

Is there a browser version of inline edit?

Cursor's docs do not describe a browser version of inline edit. The page at cursor.com/agents hosts Cloud Agents in the browser, which is a separate feature.

Sources

  1. Cursor Help: inline-edit page (titled Agent mode) · Cursor · checked 2026-11-08
  2. Cursor Docs: Inline edit overview · Cursor · checked 2026-11-08
  3. Cursor Docs: Keyboard shortcuts · Cursor · checked 2026-11-08
  4. Cursor Docs: Inline edit terminal page · Cursor · checked 2026-11-08
  5. Cursor Community Forum: 'Cmd+K Has Been Retired' thread · Cursor Community Forum · checked 2026-11-08
  6. Cursor Changelog · Cursor · checked 2026-11-08
  7. Cursor Changelog: Cursor 3.0 'New Cursor Interface' · Cursor · checked 2026-11-08

Try Lazur free for 3 days

Hold a key and ask. Lazur sees your screen, points at the button and talks you through it, in any Mac app. No credit card.