Windows Terminal Close Tab Warning: Enable or Disable
In this article
Yes, you can enable or disable the warning prompt when closing multiple tabs in Windows Terminal by modifying its settings JSON file. This feature helps prevent accidental closure of multiple running sessions, especially when working with important processes. The setting is not available through a GUI toggle, so you must edit the configuration file directly. Before beginning, ensure you have the latest version of Windows Terminal installed from the Microsoft Store or GitHub, as older versions may lack this option or use different syntax.
What You'll Need
- Windows 10 or Windows 11 (64-bit)
- Windows Terminal installed (version 1.11 or later recommended)
- Administrator privileges (not always required, but helpful if file access is restricted)
- Basic familiarity with JSON formatting (to avoid syntax errors)
- A text editor such as Notepad, Notepad++, or Visual Studio Code
Step-by-Step
- Open Windows Terminal. Right-click the title bar or tab area and select Settings from the context menu. This opens the settings interface in your default browser or within the app, depending on your version.
- In the settings window, locate and click on the Open JSON file option, usually found in the lower-left corner. This opens the
settings.jsonfile in your default text editor. - Inside the JSON file, look for the main
"profiles"object. Within it, search for a setting named"confirmCloseAllTabs". If it doesn’t exist, you’ll need to add it. - To enable the warning, add or modify the line to read:
"confirmCloseAllTabs": true. To disable the warning, set it tofalse. - Ensure the line is placed correctly within the JSON structure. It should be inside the root-level object, alongside other global settings like
"defaultProfile"or"alwaysShowTabs". Do not place it inside a specific profile’s settings unless you intend to override it per profile. - After making the change, save the file. If you get a permission error, save it to your desktop first, then manually copy and replace the original file located at:
%LOCALAPPDATA%\\Packages\\Microsoft.WindowsTerminal_8wekyb3d8bbwe\\LocalState\\settings.json. - Close and restart Windows Terminal. Open multiple tabs, then attempt to close the window or use Ctrl+Shift+W to close all tabs. If enabled, a confirmation dialog should appear asking if you’re sure you want to close all tabs.
Common Mistakes
- Editing the wrong JSON file — ensure you are modifying the correct
settings.jsonin the Windows Terminal package folder, not a custom or backup version. - Incorrect JSON syntax — missing commas, extra commas, or mismatched braces will prevent the file from loading. Use a JSON validator if unsure.
- Placing
confirmCloseAllTabsinside a profile instead of the root object — this may not apply globally and could be ignored. - Forgetting to restart Windows Terminal — changes only take effect after restarting the app.
- Assuming the GUI has a toggle — as of current versions, this setting is JSON-only and not exposed in the visual settings menu.
Tips
- Always back up your
settings.jsonfile before editing. Save a copy assettings.json.bakin the same directory. - Use an editor with JSON syntax highlighting (like VS Code) to catch formatting errors early.
- If you frequently work with multiple tabs, keep
confirmCloseAllTabsset totrueto avoid losing unsaved work. - You can also bind a custom key command to close all tabs without confirmation by defining a new action in the
keybindingssection, leaving the default close behavior protected. - Check for updates regularly — new Windows Terminal versions may add this option to the GUI or change the setting name.
Troubleshooting
If the warning does not appear after enabling confirmCloseAllTabs, first verify that the setting is at the root level of the JSON file and not nested inside another object. Check for syntax errors by opening the file in a JSON validator. If the terminal fails to start, replace the file with your backup and retry. If the setting is ignored, ensure your Windows Terminal version supports it — older versions may not recognize this key. You can check the official GitHub repository documentation for the correct schema. If the file reverts after editing, you may not have write permissions; run your text editor as administrator or adjust folder permissions. If multiple instances of Windows Terminal are open, close all before restarting to ensure the new settings load properly.
Frequently Asked Questions
Is there a GUI option to enable the close tab warning?
No, as of the current version, this setting must be edited manually in the JSON configuration file.
Why doesn’t my settings.json change take effect?
This is usually due to a syntax error or editing the wrong file. Validate the JSON and confirm the file path.
Can I set different confirmations for different profiles?
No, confirmCloseAllTabs is a global setting and cannot be configured per profile.
Does this warning work when closing via Ctrl+Shift+W?
Yes, if enabled, the confirmation appears whether you close via the X button or the keyboard shortcut.
What happens if I close without saving in a tab?
The warning only covers tab closure, not process termination. Running tasks may be interrupted without further prompts.
Can I customize the warning message?
No, the message text is hardcoded and cannot be changed through settings.