Breakpoints in Bash scripts work just like any other type of breakpoint in your IDE.
Only line breakpoints are supported. You can not set breakpoints on empty lines.
A breakpoint is only stopping execution for the first instruction on a line. You can’t step over multiple instructions on the same line.
How to Set Breakpoints
The easiest way to set a new breakpoint is to use the gutter on the left:
Click into the empty space on the left. Now the new breakpoint is displayed like this:
Once you start the debugger, an active breakpoint displays an additional check mark:
How to Remove Breakpoints
You can just click on the breakpoint icon to remove it. Alternatively, you can use the breakpoint settings dialog to manage all breakpoints at once.
A conditional breakpoint only stops the execution when the conditional evaluates to true.
To set a condition on a breakpoint:
- Right–click on the breakpoint icon
- Enter the condition into the text input field
- Close the popup to apply the settings
A conditional breakpoint is marked with a question mark:
An active, conditional breakpoint is marked with an additional check mark:
- Examples of conditional breakpoints
- The script stops at the breakpoint when the condition evaluates to
0). Here are a few examples:
A temporary breakpoint is removed as soon as it’s hit.
- Right-click on a breakpoint
- Mark the checkbox Remove after first hit (temporary breakpoint)
Your IDE provides a list of the breakpoints. This dialog also allows you to configure the properties of each breakpoint.