Run and debug the current or last Python file in VS Code with ease and out-of-the-box support.
Running and debugging Python files in VSCode quickly is at least inconvenient. Let's fix that.
Ctrl+Shift+F10creates a launch configuration for the current script and runs it -- quick and easy.Ctrl+F10runs the last configuration again -- fast re-run.Ctrl+Shift+F9andCtrl+F9do the same for debugging -- debug with the same ease.- Run and debug multiple scripts simultaneously -- no more "A debug session is already active" errors.
- Launchpad manages per-file launch configurations with predictable defaults and settings-based overrides.
- Open a Python file, be it a python script or a test file.
- Press
Ctrl+Shift+F10to run it, orCtrl+Shift+F9to debug it. - Use
Ctrl+F10/Ctrl+F9to run or debug the last valid Python target, even when editor focus is elsewhere. - The first execution of a script opens a dialog to set up the launch configuration.
- run command template (default is
python {script}) - current working directory (default is the Python workspace folder)
- select which
launch.jsonto use in multi-root workspaces (default is the target file's workspace folder)
- run command template (default is
- Subsequent runs/debugs reuse and preserve existing managed target entries, feel free to edit them.
- Run Current File
- Debug Current File
- Run Last File
- Debug Last File
- Remove Managed Target Configurations
Default shortcuts use Ctrl key combinations on all platforms:
- Debug Current File:
Ctrl+Shift+F9 - Run Current File:
Ctrl+Shift+F10 - Debug Last File:
Ctrl+F9 - Run Last File:
Ctrl+F10
- Depends on the Microsoft Python extension (
ms-python.python) for Python debugging support. - Auto-detects test files by filename (
test*.py,*_test.py). - In test files,
Run/Debug Current Fileresolves the current function or method when the cursor is inside one; otherwise, it targets the whole file. Run Last FileandDebug Last Fileare no-ops when no previous target exists.
- Run/debug commands resolve runtime templates from managed launch env keys (
PYTHON_LAUNCHPAD_RUN_COMMAND/PYTHON_LAUNCHPAD_TEST_COMMAND) with safe fallbacks. - Debug commands choose pytest or unittest based on Python test settings (
python.testing.pytestEnabled/python.testing.unittestEnabled). Debug Current FileandDebug Last Filelaunch by managed configuration name for script targets, so the Run and Debug panel keeps the selected Launchpad target forF5reuse.- Run commands mirror the managed configuration environment, so
cwd,envFile, andenvbehave the same as debugging:envFileis loaded first, then inlineenventries override it (anenvvalue ofnullremoves the variable).- When the managed configuration has no
envFile, the Python extension'spython.envFilesetting is used, exactly as it is for debugging (default${workspaceFolder}/.env, silently skipped when absent). cwd,envFile, and inlineenvvalues resolve${workspaceFolder},${workspaceFolder:name},${workspaceFolderBasename},${file},${fileDirname},${fileBasename},${fileBasenameNoExtension},${fileExtname},${relativeFile},${relativeFileDirname},${userHome},${env:NAME}, and${pathSeparator}.- As in VS Code,
${workspaceFolder}is the workspace folder that owns the managedlaunch.json, while${workspaceFolder:name}can reference any folder of a multi-root workspace. - A configured
envFilethat cannot be resolved or read reports a warning instead of running with the variables silently missing.
- Prints a terminal summary tail after each run with outcome, exit code, and runtime (green for success, red for failure).
- Creates and updates only extension-managed debug configurations.
- Existing managed target configurations are never overwritten once created.
- User-managed launch configurations remain untouched.
Command template settings:
-
cleatsPythonLaunchpad.runCommandTemplate- Default:
python {script} - Used for script targets and written to
PYTHON_LAUNCHPAD_RUN_COMMANDwhen creating a managed target.
- Default:
-
cleatsPythonLaunchpad.testCommandTemplate- Default:
python -m pytest {testTarget} - Used for test targets and written to
PYTHON_LAUNCHPAD_TEST_COMMANDwhen creating a managed target.
- Default:
-
cleatsPythonLaunchpad.generatedLaunchNamePrefix- Default:
Launchpad
- Default:
-
cleatsPythonLaunchpad.launchJsonPath- Default: empty string
- Optional path that selects which
launch.jsonCleats manages in multi-root workspaces. - Supports absolute file path to
launch.jsonor a folder path (mapped to<folder>/.vscode/launch.json). - If empty, Cleats uses the target Python file's workspace folder.
-
cleatsPythonLaunchpad.managedTargetConfigurationLimit- Default:
20 - Limits managed Launchpad target entries per workspace-folder
launch.json. - If creating a new managed target exceeds the limit, the least-recent managed target (first in order) is removed.
- Existing targets keep their order when run/debugged again.
- Default:
-
cleatsPythonLaunchpad.launchConfigurationTemplate- Default:
{} - JSON object applied as a base override for newly created managed target launch configurations.
- Use it to define defaults (for example
justMyCode,subProcess,env,envFile) without editing managed launch entries manually.
- Default:
-
cleatsPythonLaunchpad.executeDialogEnabled- Default:
true - If
true, first execution of an unmanaged target shows a setup dialog before the managed target configuration is created. - Dialog customization order: run command template, current working directory, then launch target workspace folder (multi-root only).
- Default:
-
cleatsPythonLaunchpad.runOpenNewTerminalIfBusy- Default:
true - If
true, run commands open a new terminal when a previous Cleats run is still active.
- Default:
-
cleatsPythonLaunchpad.debugOpenNewTerminalIfBusy- Default:
true - If
true, debug commands can launch an additional debug session when a matching target is already active.
- Default:
-
cleatsPythonLaunchpad.terminalReveal- Allowed values:
always,silent,never
- Allowed values:
- Fixed run commands ignoring
envFilewhen it points at another workspace folder (for example${workspaceFolder:backend}/.env) while the managedlaunch.jsonlives in a different folder; debugging already worked in this case. - Aligned variable resolution for
cwd,envFile, and inlineenvvalues on one resolver that also supports${workspaceFolderBasename},${file},${fileBasenameNoExtension},${fileExtname},${relativeFileDirname},${userHome},${env:NAME}, and${pathSeparator}. - Inline
envvalues now resolve launch variables before they reach the run terminal, so entries such as"PYTHONPATH": "${workspaceFolder}/src"no longer leak the literal placeholder. - Run commands now honor the
python.envFilesetting (default${workspaceFolder}/.env) when the managed configuration defines noenvFile, matching how the Python debugger resolves it. - Unresolvable or unreadable
envFilevalues now warn instead of running with the environment silently missing. - Fixed unittest module targets when
cwddiffers from the workspace folder; the dotted path is now resolved against the execution directory, with a-kfilter fallback when the file sits outside it. - Reusing an existing managed target no longer rewrites
launch.json, which previously reformatted the file on every run or debug. - Fixed quoting of run command arguments on Windows
cmd.exe.
- The first stable release! All core features are now in place.
- Internal refactoring and optimizations.
- Fixed run/debug behavior in multi-root workspaces so Launchpad resolves and launches from the correct target workspace folder.
- Added support for named workspace-folder variables in
cwd(for example${workspaceFolder:project_a}) when running targets. - Improved default keybinding behavior by skipping Launchpad commands in the integrated shell, ensuring shortcuts execute the extension commands reliably.
- Added setup-dialog support for first-run script execution.
- Improved configuration behavior for managed launch flows.
- Removed legacy behavior to keep execution paths deterministic.
- Added managed template env keys
PYTHON_LAUNCHPAD_RUN_COMMANDandPYTHON_LAUNCHPAD_TEST_COMMAND. - Updated run/debug flows to resolve execution commands from managed target
envvalues with safe fallbacks. - Standardized command-template behavior for more predictable target execution.
- Consolidated script and test command handling into a unified
testCommandTemplateflow. - Updated run-current and run-last command logic to support the unified template behavior.
- Added debug-busy terminal tracking to improve concurrent debug session handling.
- Added terminal-tail run summaries, including exit code and runtime for every run.
- Added ANSI coloring for terminal-tail summaries (green success, red failure).
- Tightened VSIX packaging to keep publish artifacts runtime-focused.
- Added run/debug commands for current and last Python file targets.
- Established the initial managed launch configuration workflow.