How-to · VS Code for Mac
How to set a breakpoint in VS Code on Mac: steps for macOS and 2026
To set a breakpoint in VS Code on Mac, click the editor margin just left of the line number, and a red dot appears. Or place your cursor on that line and press F9, which turns the breakpoint on or off.
Quick answer
- Click the editor margin left of a line number. A solid red dot means the breakpoint is enabled.
- Put the cursor on a line and press F9 to toggle a breakpoint. If F9 does nothing, check the Mac function key setting.
- Press F5 to start debugging. The program pauses when it reaches an enabled breakpoint.
- Conditional breakpoints, logpoints and function breakpoints use the right-click menu, the Command Palette and the BREAKPOINTS list.
What you need
- VS Code installed on macOS. These steps were checked against version 1.145.
- A file with code that runs, such as a Python or JavaScript file.
- A debugger for your language. VS Code asks you to choose one when you press F5.
- The Mac setting for standard function keys, if F9 does nothing (see the steps).
How to Set a breakpoint in VS Code on Mac in VS Code on a Mac
Open the file and find a line of code
Open the file you want to debug in the VS Code editor. Scroll to a line that does real work, such as an assignment, a loop, or a function call. Skip blank lines and comments.
Tip: Not sure where to start? Choose the first line inside the function you care about.
Click the editor margin
Move the pointer to the narrow strip just left of the line number. Click once. A solid red circle appears, which means the breakpoint is enabled. Click the red circle again to remove it.
Tip: A hollow gray circle means the debugger could not register the breakpoint, often because the line has no code.
Or press F9 on the line
F9
Put the cursor anywhere on the line. Press F9. The breakpoint toggles on that line. Press F9 again to remove it.
Tip: If F9 does nothing or triggers a Mac feature, go to the next step.
Fix F9 if it does nothing
Open System Settings, then go to Keyboard, Keyboard Shortcuts, and Function Keys. Turn on Use F1, F2, etc. keys as standard function keys. Apple describes this for macOS Ventura or later.
Tip: Prefer not to change the setting? Hold Fn and press F9 instead while the setting is off.
Add a conditional breakpoint or logpoint
Right-click the editor margin or an existing red dot. Choose Add Conditional Breakpoint, Add Logpoint, Add Triggered Breakpoint, or Edit Breakpoint. Type the condition or message that VS Code asks for.
Tip: Condition syntax depends on your debugger extension, so test it on a simple value first.
Start debugging
F5
Press F5. If VS Code asks for a debugger, choose the one for your language. The program runs, and it pauses when it reaches an enabled breakpoint.
Tip: Starting without debugging skips breakpoints, so use F5 and not a plain run command.
Check the BREAKPOINTS list
⇧⌘D
Press ⇧⌘D to open the Run and Debug view. Look at the BREAKPOINTS section. Filled red means enabled. Filled gray means disabled.
Tip: Use the pencil icon in the BREAKPOINTS section to edit a breakpoint.

What a breakpoint does in VS Code
A breakpoint tells the debugger to pause your program on one line. When the program reaches that line, it stops before running it. You can then read variable values, check the call stack, and step through the code one line at a time.
Breakpoints only work in debug mode. If you start the program without debugging, VS Code ignores every breakpoint you set. Press F5 to run in debug mode after you place them.
Set a breakpoint by clicking the editor margin
The editor margin is the narrow strip to the left of the line numbers. Click it on the line where you want to pause. A solid red circle appears. That circle is an enabled breakpoint, and it stays until you remove it.
Click the red circle again to remove the breakpoint. The line goes back to normal, and the debugger no longer stops there. Nothing else in your file changes.
Pick a line that runs code
Not every line can hold a breakpoint. Comments and blank lines cannot. Many declarations cannot either. Choose a line that does real work, such as an assignment, a loop, an if statement, or a function call.
- Good: a line that assigns or changes a value.
- Good: the first line inside a function you want to inspect.
- Poor: a comment, a blank line, or a line that holds only a closing brace.
- Always check the dot after you click. A hollow gray circle means the debugger could not register it.
A hollow gray circle usually means the line has no executable code, or the debugger does not support that file. Move the breakpoint to a nearby line that runs code, then check the dot again.
Use F9 when clicking is awkward
Click into the line you want, then press F9. The breakpoint toggles on that line. Press F9 again to remove it. This beats aiming at a thin strip in a long file, or when a trackpad makes small clicks hard.
| Action | Shortcut on Mac | What it does |
|---|---|---|
| Set or remove a breakpoint | F9 | Toggles a breakpoint on the line with the cursor |
| Start debugging | F5 | Runs the program with the debugger attached |
| Open the Run and Debug view | ⇧⌘D | Shows the BREAKPOINTS section and the debug controls |
| Add an inline breakpoint | ⇧F9 | Adds one during a debugging session |
| Open the Command Palette | ⇧⌘P | Finds any VS Code command by name |
| Open the Debug Console | ⇧⌘Y | Shows debug output and evaluates expressions |
The shortcuts assume a standard US keyboard layout. If you use another layout, some keys sit in a different place. To find a missing shortcut, open Preferences: Open Default Keyboard Shortcuts (JSON) from the Command Palette.
Why F9 does nothing on a Mac
This is the most common snag. On a Mac keyboard, F9 is a function key. macOS can send the top row to system features instead of to apps like VS Code. So F9 can do nothing at all.
Apple controls this with a setting. Open System Settings, then go to Keyboard, Keyboard Shortcuts, and Function Keys. Turn on Use F1, F2, etc. keys as standard function keys. Apple describes this for macOS Ventura or later.

Breakpoint types and icons
VS Code uses several breakpoint types. Each one has its own shape in the editor and in the BREAKPOINTS list. Knowing the shapes tells you what kind of breakpoint you are looking at.
| Type | Icon | How to add it |
|---|---|---|
| Line | Filled red circle | Click the margin or press F9 |
| Conditional | Not described in the docs | Right-click the margin, then choose Add Conditional Breakpoint |
| Function | Red triangle | Plus sign in the BREAKPOINTS section |
| Data | Red hexagon | Right-click a variable, then choose a Break on action |
| Logpoint | Diamond | Right-click the margin, then choose Add Logpoint |
| Triggered | Not described in the docs | Right-click the margin, then choose Add Triggered Breakpoint |
Filled red means enabled. Filled gray means disabled. Hollow gray means the debugger could not register the breakpoint. Those three states matter more than the shape when something stops working.
Conditional breakpoints and logpoints
A conditional breakpoint pauses only when an expression is true. Use one when a loop runs many times and you care about one pass. Right-click the margin, choose Add Conditional Breakpoint, and type the expression.
Say a loop goes through every order in a list, and one order has the wrong total. Set a conditional breakpoint on the total line. Use a condition that matches only that order's ID. The program then pauses on that one pass and nowhere else.
Condition syntax follows your language and your debugger. A Python condition is ordinary Python. A JavaScript condition is ordinary JavaScript. Test the expression on a simple value first, because a typo can stop the breakpoint from firing.
A logpoint does not pause. It prints a message each time the line runs, so the program keeps moving. Add one from the margin menu, or run Debug: Add Logpoint from the Command Palette. Logpoints only work if your debugger supports them.
A triggered breakpoint waits for another breakpoint to be hit first. Use it when a bug shows up late in a sequence, and you want to skip the early steps.
Function breakpoints and the BREAKPOINTS list
A function breakpoint pauses when a named function runs. You do not need to open the file that holds it. Open the Run and Debug view with ⇧⌘D, then click the plus sign in the BREAKPOINTS section and type the function name.

The BREAKPOINTS section lists every breakpoint in your project. Click the pencil icon to edit one. That is the same Edit Breakpoint action you get from the margin menu, so you can add a condition after the fact.
A long list gets hard to scan. Set debug.breakpointsView.presentation to tree to group breakpoints by file. Set debug.showBreakpointsInOverviewRuler to show breakpoints on the scrollbar while you scroll.
Start the debugger and watch it stop
Press F5 to start. If VS Code asks which debugger to use, choose the one that matches your language. VS Code creates a launch.json file when your app needs a specific entry point, arguments, or environment variables.
When the program reaches an enabled breakpoint, it pauses. Check the variables while it is stopped. Press F5 to continue to the next breakpoint. Press F11 to step into the function call on the paused line.
Open the Debug Console with ⇧⌘Y to read program output while it is paused. You can also type an expression there to test a value before you change any code.
Mistakes people make with breakpoints on a Mac
- Clicking a comment or a blank line. The dot turns hollow gray and never stops.
- Pressing a plain run command instead of starting the debugger. Breakpoints are skipped.
- Assuming F9 works without checking the function key setting first.
- Leaving an old condition on a breakpoint. The stop you want never happens.
- Expecting a logpoint to pause. It only prints a message.
- Debugging a copy of the file in another folder. Check which file path the debugger uses.
The last mistake is common in projects with several folders. Open the file from the folder the debugger runs, then set the breakpoint there. Otherwise the dot looks right, and the code still never pauses.
When a VS Code breakpoint does not hit
The official debugging docs do not include a troubleshooting section for breakpoints that never trigger. Forum posts and GitHub issues offer fixes. Microsoft has not verified them, so treat them as checks to try, not guarantees.
- Confirm the dot is filled red, not gray or hollow.
- Confirm you started with F5 and not a plain run command.
- Check that the program path in launch.json points at the file you edit.
- For compiled or transpiled code, rebuild and check source maps or outFiles.
- Restart VS Code, then start the session again.
The first two checks take almost no time, so start there. Move down the list only if the breakpoint still stays silent.
Breakpoints on the web and in remote setups
VS Code for the Web has no debugger and no terminal. You cannot set a breakpoint that stops code there. Use the desktop app on your Mac for debugging.
If your code runs somewhere else, the VS Code docs list GitHub Codespaces and a remote tunnel as options for running, building, or debugging. Check the docs for the setup steps before you connect.
What changed in VS Code 1.145
VS Code 1.145 was released on November 4, 2026. The current update on the download page is 1.145.2. The release notes list no changes to the Run and Debug view, breakpoints, or the debugger.
Version 1.110 came out on March 4, 2026. It renamed the Event Listener Breakpoints view to Browser Options. If you debug browser code, that is the name you will see. It also added an Emulate a focused page option.
Keys and next steps
Once breakpoints feel natural, learn the step keys. The keybindings reference lists F9, F5, and F11, but it leaves out some stepping keys. Run Preferences: Open Default Keyboard Shortcuts (JSON) from the Command Palette to see the full list.
To run the file you are debugging, read How to run a Python file in VS Code on Mac. To find the debugger you need, see How to install an extension in VS Code on Mac.
For the Command Palette steps used above, see How to use the command palette in VS Code on Mac.
VS Code shortcuts for this on Mac
| To do this | Press |
|---|---|
| Set or remove a breakpoint on the line | F9 |
| Add an inline breakpoint during debugging | ⇧F9 |
| Start debugging | F5 |
| Open the Run and Debug view | ⇧⌘D |
| Open the Command Palette | ⇧⌘P |
| Open the Debug Console | ⇧⌘Y |
| Step into a function call | F11 |
| Send a standard F9 while the function key setting is off | FnF9 |
If it does not work
- F9 does nothing or triggers a Mac feature
- Turn on Use F1, F2, etc. keys as standard function keys in System Settings > Keyboard > Keyboard Shortcuts > Function Keys. Or hold Fn and press F9. If that setting is missing, the keyboard may not be an Apple keyboard, so use the margin click.
- The breakpoint dot is hollow gray
- The debugger could not register the breakpoint. Move it to a line with executable code, or check that your debugger supports the file type.
- The breakpoint never stops the program
- Confirm the dot is filled red. Confirm you started with F5, not a plain run command. Check that the program path in launch.json points at the file you edit. Restart VS Code and try again. Microsoft does not document these checks as fixes.
- The program stops in a copy of the file or in the wrong place
- This often comes from compiled or transpiled code. Rebuild the project and check source maps or outFiles in launch.json. This is a community fix, not an official VS Code troubleshooting step.
- A conditional breakpoint never pauses
- Test the condition with a simple value. Check the syntax for your language and debugger, and read the debugger extension's documentation. Remove any old condition you no longer need.
- A logpoint does not pause
- That is expected. A logpoint prints a message and keeps running. Use a conditional breakpoint if you need the program to pause.
Faster with Lazur
Do it faster: ask Lazur while you are in VS Code
Hold ⌥ ⌘ and say what you want. Lazur sees your VS Code 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 VS Code. Nothing to copy into a chat window.
Free for 3 days, then $18/month. Download for Mac
You say“Where is the Run and Debug button?”
Lazur · points at itLazur circles the Run and Debug icon in VS Code and labels it. It does not click the icon for you.
Questions people ask
Why is my breakpoint gray?
A filled gray dot means the breakpoint is disabled. A hollow gray dot means the debugger could not register it, often because the line has no executable code. Move the breakpoint to a line that runs code, then check the dot again.
Can I set a breakpoint before I press F5?
Yes. You can set breakpoints in the editor at any time. They only pause the program once you start debugging with F5. If you start without debugging, the program runs straight through them.
What is the difference between a breakpoint and a logpoint?
A breakpoint pauses the program on its line. A logpoint keeps the program running and prints a message instead. Logpoints show as diamonds, and they work only if your debugger supports them.
How do I remove every breakpoint at once?
The VS Code docs do not name one command that removes all breakpoints. Click each red dot in the editor, or press F9 on each line. The BREAKPOINTS section in the Run and Debug view also lists them, so you can check.
Are the shortcuts the same on Windows?
Not for every key. The debugging docs list Ctrl+Shift+D for the Run and Debug view on Windows and Linux, where Mac uses ⇧⌘D. Check the default keybindings reference for the rest, since it does not cover every command.
Why does a breakpoint work in one file but not another?
The file has to be part of the program the debugger runs, and the debugger must support that language. Check your launch.json configuration. If the program runs a different copy of the file, the breakpoint sits in a file that never runs.
Can I debug in VS Code for the Web?
No. VS Code for the Web does not include a debugger or a terminal. Use the desktop app on your Mac instead. GitHub Codespaces and a remote tunnel are other options listed in the docs.
Do I need an extension to set breakpoints?
You need a debugger for your language. If VS Code asks you to choose one when you press F5, pick the one that matches your code. If none is installed, install one from the Extensions view.
Sources
- Debugging - Visual Studio Code docs · Microsoft · checked 2026-11-09
- Debug code with Visual Studio Code · Microsoft · checked 2026-11-09
- Default Keyboard Shortcuts - Visual Studio Code · Microsoft · checked 2026-11-09
- Visual Studio Code 1.145 release notes · Microsoft · checked 2026-11-09
- February 2026 (version 1.110) · Microsoft · checked 2026-11-09
- VS Code for the Web · Microsoft · checked 2026-11-09
- How to use the function keys on your Mac · Apple · checked 2026-11-09
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.