Fixing iTerm 2: Prevent Non-Hotkey Window from Opening Automatically

Abstract: Disable Restore previous sessions on startup in iTerm 2 General preferences to prevent non-hotkey windows from opening automatically.

Created: 2026-08-21 by

Prevent iTerm 2 from opening extra windows by navigating to Preferences under the iTerm menu, selecting the General tab, and locating the Window Restoration section. Uncheck or disable the option labeled Restore previous sessions on startup. This action stops the application from automatically recreating your previous terminal layout every time you launch it, ensuring a clean slate each session.

Understanding Window Restoration Behavior

Many users find that iTerm 2 behaves differently than other macOS applications when it comes to closing and reopening. While most apps simply close their main window, terminal emulators often attempt to preserve the state of multiple panes, tabs, and splits. This feature is designed for productivity, allowing developers to resume complex workflows without reconfiguring their environment. However, this convenience can become a nuisance if you prefer starting with a single, empty window every time you open the terminal. The core issue lies in how iTerm 2 handles session persistence. By default, the application saves the state of all open windows, including those created via hotkeys or manual interactions. When you quit the application, it writes this state to disk. Upon relaunch, it reads this file and attempts to reconstruct the exact environment you left behind. If you have inadvertently closed only the hotkey window but left another pane open, or if the restoration policy is set too broadly, iTerm 2 will spawn additional windows to match the saved configuration. This results in the unexpected appearance of non-hotkey windows upon startup. To address this, we must look at the specific settings governing this behavior. The solution does not involve complex scripting or external tools but rather a straightforward adjustment within the application's native preferences. By modifying the restoration policy, you gain full control over whether iTerm 2 should remember your previous session or start fresh. This approach aligns with best practices for maintaining a predictable development environment, especially when using hotkey windows for quick tasks while keeping the main workspace clear. For more information on managing terminal configurations, see iTerm2: Running Commands Every New Pane, which explores further customization options for your shell environment.

Locating the General Preferences Tab

The first step in resolving this issue is accessing the correct settings panel. Open iTerm 2 and click on iTerm in the top-left menu bar of your screen. From the dropdown menu, select Preferences... (or press Cmd + ,). This opens the main preferences window, which contains several tabs for different aspects of the application's behavior. Navigate to the General tab. This section houses fundamental settings related to the application's lifecycle, including updates, notifications, and window management. Within the General tab, look for the subsection titled Window Restoration. This area specifically controls how iTerm 2 handles the saving and loading of window states. It is crucial to interact with this specific section, as other tabs like Keys or Profiles do not contain the necessary toggles for session persistence. If you do not see the Window Restoration section immediately, ensure you are on the correct tab. Some older versions or custom builds might organize these settings slightly differently, but the standard distribution places them here. Once located, you will see a checkbox or toggle switch that dictates whether previous sessions are restored.

Disabling Session Restoration

In the Window Restoration section, you will find an option labeled Restore previous sessions on startup. To prevent non-hotkey windows from opening automatically, uncheck this box. This setting is the primary driver for the behavior described in the problem statement. When enabled, iTerm 2 saves the state of all open windows, including splits and tabs, and restores them exactly as they were when the application was last closed. By disabling this option, you instruct iTerm 2 to start with a default configuration every time. This means that even if you had ten panes open during your last session, launching the application again will result in a single, empty window. This is particularly useful for users who frequently use the hotkey window feature for quick commands and do not want their main desktop cluttered with residual terminal instances. After unchecking the box, close the Preferences window. The changes take effect immediately for new sessions. You may need to quit iTerm 2 completely and restart it to verify that the behavior has changed. If you still experience issues, ensure that no other plugins or scripts are overriding this setting. For example, some users employ shell profiles that auto-launch additional windows, which would bypass iTerm 2's internal restoration logic. Another common cause for unexpected windows is the use of third-party utilities that manage window placement or auto-open terminals based on system events. If disabling the restoration option does not solve the problem, consider reviewing any active daemons or background processes that might be triggering terminal launches. Additionally, check your shell configuration files (.zshrc or .bash_profile) for any commands that might spawn new instances. For tips on cleaning up your terminal environment, refer to How to delete all the color presets in iTerm2?, which offers guidance on streamlining your visual settings.

Verifying Hotkey Window Settings

While disabling general restoration solves the majority of cases, it is worth verifying your hotkey window configuration. Navigate to the Keys tab in Preferences and locate the Hotkey Window section. Ensure that the hotkey is assigned correctly and that the window type is set to Global Hotkey. Sometimes, conflicts between global hotkeys and local shortcuts can cause unexpected window behaviors. If you rely heavily on the hotkey window, you might want to keep it separate from the restoration policy. Unfortunately, iTerm 2 does not offer a granular setting to restore only the hotkey window while ignoring others. Therefore, the most reliable method remains disabling restoration entirely. If you need to preserve certain sessions, consider using iTerm 2's built-in bookmarking feature or saving specific profiles instead of relying on automatic restoration.

Frequently Asked Questions

Will disabling restoration delete my current open windows?

No, disabling this setting only affects future startups. Your currently open windows will remain intact until you choose to close them. When you quit iTerm 2 after making this change, it will not save the state of those windows, so they will not reappear next time you launch the app.

Can I restore only specific windows while ignoring others?

The native preferences do not support selective restoration based on window type. You must either restore all previous sessions or none at all. If you need fine-grained control, you may need to use AppleScript or third-party automation tools to manage window states manually.

Why do non-hotkey windows still appear occasionally?

If you have disabled restoration but still see extra windows, check for shell scripts or aliases that might be spawning new instances. Also, ensure that no other applications are interacting with iTerm 2 via command line arguments that force window creation.

Does this fix apply to iTerm 3 beta versions?

Yes, the Window Restoration setting in the General tab remains consistent across stable and beta releases of iTerm 2 and iTerm 3. The location and naming of the option have not changed in recent updates.

How do I reset my preferences if I make a mistake?

You can reset all preferences by holding down the Option key while clicking the Reset button in the bottom-left corner of the Preferences window. This will revert all settings to their default values, including the restoration policy.

Latest News

How to Display Output of xterm Command in Terminal Screen using Cron

Resolve the inability to display xterm output in a terminal screen from cron by redirecting logs or using wall instead of insecure X11 workarounds.

Read More
Expose Local Server on VPS Preserving Real Client IPs (OS Level)

Resolve VPS logging showing only gateway IPs by configuring reverse proxies to forward real client addresses via X-Forwarded-For headers.

Read More
How to Clear Recent Files History in Linux without Deleting Actual Files?

Clear recent files history in Linux by deleting ~/.local/share/recently-used.xbel without removing the actual files.

Read More
Best HDD Copy Strategy: Manually Syncing and Rewriting Scratch

Resolve data drift between two 4TB hard drives by using rsync with the --delete flag to manually sync and rewrite scratch data for an exact mirror.

Read More
Understanding Bash Prompt Abbreviations: An Overview

Resolve repetitive typing errors by creating and persisting Bash aliases in the .bashrc file for improved command-line efficiency.

Read More
Free Tools and Methods to Log Real-Time Performance Details in Task Manager

Log real-time CPU and memory metrics to CSV files using Windows Performance Monitor Data Collector Sets to troubleshoot system slowness.

Read More
Contact Qatar Airways Customer Service: Phone Number, Help Center, and More

Resolve urgent Qatar Airways reservation issues like flight changes and baggage claims using the US phone number +1801-855-5905 or online self-service tools.

Read More
Windows 11: Alt Codes Displaying Wrong Characters - Solutions

Resolve Windows 11 Alt codes showing wrong characters by verifying the US keyboard layout and enabling Num Lock.

Read More
Run Programs with Elevated Privileges: A Comprehensive Guide

Eliminates the need to type sudo for frequent administrative tasks by configuring .bashrc aliases or functions.

Read More
Dynamically Changing Dates in Excel Formulas Using Cells

Eliminate manual date updates in Excel by using cell references to create dynamic formulas that automatically adjust calculations when input dates change.

Read More
Granting Edit Access to a Specific Excel Sheet in an Office 365 User Email ID-Based Login

Excel Online lacks native sheet-level permissions, so users must split workbooks or use worksheet protection to isolate edit access for specific tabs.

Read More
Creating Network Load on Local Wi-Fi from One PC

Generate sustained Wi-Fi bandwidth load from a single PC using a VM SFTP server to test router stability and throughput.

Read More
Changing the Default Editor for Batch Files in Windows 11's File Explorer

Resolve the issue of batch files opening in Notepad by changing the default editor to a preferred application like VS Code.

Read More
Gain WiFi Connection Minutes Before Losing it by Changing MAC Address

Bypass MAC address filtering to restore WiFi connectivity temporarily when a device is blocked by network administrators.

Read More
Photos Folders Turned Black: Troubleshooting Picture Applications on Windows

Resolve black screens in Windows Photos by resetting the app, updating graphics drivers, and repairing system files.

Read More
Troubleshooting High CPU Temperature Values: A Step-by-Step Guide

Resolve high CPU temperatures and thermal throttling by monitoring with Speedfan, cleaning dust from cooling components, and replacing degraded thermal paste.

Read More
Make cURL establish TLS connection with CA unknown

Resolve cURL TLS connection failures with unknown or self-signed certificates by using the --insecure flag to bypass CA validation.

Read More
Troubleshooting Incorrect Network Metrics Values in Grafana, Prometheus, InfluxDB, and Telegraf

Fix incorrect network metrics in Grafana, Prometheus, InfluxDB, and Telegraf by verifying interface selection, resolving unit mismatches, and handling counter resets.

Read More
Start Another Terminal Window (cmd.exe) Windows Repair/Troubleshoot

Provides step-by-step instructions to access the Windows Command Prompt via bootable media for advanced system repair and troubleshooting.

Read More
Thinkpad P1 Gen 6: Sudden Thunderbolt 3 Dock USB-C Charging Stopped Working

Resolve sudden Thunderbolt 3 dock USB-C charging and internet failure on ThinkPad P1 Gen 6 by updating firmware, resetting the dock, and adjusting power settings.

Read More
ASUS Windows 11 Laptop: Internet Connection Issue with Hotspot

Resolve ASUS Windows 11 laptop spinning wheel issue when connecting to mobile hotspot by resetting network stack, disabling IPv6, and adjusting power settings.

Read More
Developing iOS Project with Firebase: Logging in and Sending Push Notifications

Integrates Firebase to enable secure user authentication and push notifications in iOS applications.

Read More
Troubleshooting Bash Script with Suspected Issues of Spaces, Dashes, Filenames and Quoting

Resolve Bash script failures caused by word splitting, globbing, and special characters in filenames by applying proper quoting techniques.

Read More
Populating OneDrive Folder for Local Backup without Affecting Remote Files

Prevent OneDrive from deleting remote files during Windows reinstallation by unlinking the account or using symbolic links to isolate local data.

Read More
Force First Frame as Keyframe Without Re-encoding: A Quick Solution

Resolve inaccurate seeking and playback glitches by re-encoding video to ensure the first frame is a valid keyframe.

Read More
Find Information in Database Using WSL (Ubuntu) on Windows-10

Resolve database connection issues from WSL Ubuntu on Windows 10 by configuring client tools and network access to query remote or local servers.

Read More
Configuring a New Router with Different Networks: One Family, One Guest

Resolve IP conflicts and isolate guest traffic by configuring a second router with a distinct subnet via its WAN port.

Read More
Quickly Open Multiple Stock Websites with a Single Command

Solve the problem of manually opening multiple stock research websites by creating a single command to launch them simultaneously on Windows, macOS, or Linux.

Read More
Improved Adobe Acrobat Search Experience: Access Advanced Search with Ease

Access advanced search filters like case sensitivity and regex in Adobe Acrobat by clicking More Options in the Find bar.

Read More
Port Forwarding VM via OpenVPN: A Comprehensive Guide

Configure OpenVPN server and iptables to forward specific ports from VPN clients to a virtual machine's internal IP address.

Read More
Understanding Partitions in the 1980s: A Look Back at MS-DOS and Master Boot Record

Explains how the Master Boot Record and partition table enabled MS-DOS to manage multiple disk volumes on a single physical drive.

Read More
Windows 10 Enterprise: Keyboard Not Detected in Managed Organization with Admin Privileges

Resolve Windows 10 Enterprise keyboard detection failures caused by Group Policy restrictions, driver corruption, or USB enumeration errors.

Read More
Can't Find x86_64 Versions of Applications on MacOS arm64 (M1)

Resolve missing x86_64 app issues on M1 Macs by installing Rosetta 2 and reinstalling apps as universal binaries.

Read More
How to Hide Installation Source for an Android App

Manage Android app installation source visibility by using USB transfers or file managers to reduce browser traces and isolate data via work profiles.

Read More
Connecting Momentus 4200.2 ST9808210A Hard Drive via USB Cable

Resolve inability to access Seagate Momentus 4200.2 ST9808210A hard drive by connecting it via USB using a compatible SATA-to-USB adapter and configuring the disk in Windows.

Read More