Understanding Auto-Scroll Behavior
IntelliJ IDEA includes a convenience feature designed to reduce visual clutter. When Auto-Scroll from Source is enabled, any action that changes the active file in the editor—such as clicking a different tab, using keyboard shortcuts like Ctrl+Tab, or navigating via breadcrumbs—triggers the IDE to close or hide project-related tool windows. This behavior assumes that your primary focus is on code editing rather than file system navigation.
However, many developers find this automatic closure disruptive, especially when they need to frequently reference the project structure while coding. For instance, if you are refactoring code and need to drag files around or quickly locate a configuration file, having the Project window disappear every time you switch tabs adds unnecessary friction to your workflow. Disabling this feature restores the ability to have a persistent view of your project hierarchy alongside your active code.
Disabling Auto-Scroll from Source
The most direct way to resolve this issue is by toggling the auto-scroll setting within the Project tool window itself. You do not need to search through complex global settings menus for this specific toggle. Follow these steps to ensure the Project window stays open:
- Open the Project Tool Window: Press
Alt+1on Windows/Linux orCommand+1on macOS to bring the Project window into focus. If it is already visible, simply click anywhere inside it to ensure it is the active component. - Locate the Magnet Icon: Look at the toolbar located at the top of the Project tool window. You will see several icons representing various actions. Find the icon that looks like a small magnet with two arrows pointing towards each other, or simply a magnet. This icon represents the "Auto-Scroll from Source" feature.
- Toggle the Setting: Click the magnet icon once. When the feature is enabled, the icon appears pressed or highlighted. Clicking it again disables the feature. The icon should return to its default, unpressed state.
Once you have clicked the magnet icon to disable it, try switching between editor tabs. You will notice that the Project tool window remains open and retains its scroll position and expanded folders. This change applies immediately to the current session and is typically remembered for future sessions within the same project workspace.
Alternative Method via Settings
If you prefer to manage this setting globally or cannot find the icon in the toolbar, you can access the same functionality through the main settings menu. Navigate to File > Settings (or IntelliJ IDEA > Preferences on macOS). In the left-hand pane, expand Editor and select General. Under the Appearance section, look for the checkbox labeled Auto-Scroll from Source. Unchecking this box achieves the same result as toggling the magnet icon but affects the entire IDE environment rather than just the specific tool window instance.
Managing Other Tool Windows
While the Project window is the most common culprit for unwanted closures, other tool windows such as Run, Debug, or Terminal may also be affected by similar auto-hide behaviors. IntelliJ IDEA treats these windows differently depending on their context. For example, the Run tool window often collapses automatically when no processes are running, which is a different mechanism than the editor-driven auto-scroll.
To keep other windows open, you can pin them. Most tool windows have a Pin button (represented by a pushpin icon) in their title bar. Clicking this pin ensures that the window stays open regardless of user activity in the editor. However, note that the Pin feature does not always override the Auto-Scroll from Source setting for all window types. If you find that the Run window still disappears despite being pinned, check the specific settings for that tool window under Settings > Tools.
Customizing Keymaps and Shortcuts
For users who rely heavily on keyboard navigation, understanding how keymaps interact with tool windows is crucial. Standard shortcuts like Ctrl+E (Recent Files) or Shift+Shift (Search Everywhere) shift focus away from the Project window, potentially triggering the auto-scroll closure. By disabling auto-scroll, these navigation methods become much smoother because you do not lose your place in the file tree.
If you frequently need to move files from the Project window into the editor, consider using drag-and-drop operations. With the Project window kept open, you can simply drag a file from the tree structure directly onto an existing editor tab to open it in a new split pane. This workflow is significantly more efficient when the window does not vanish during the process.
Additionally, some plugins or custom keymaps might introduce additional behaviors that affect window visibility. If you have recently installed a plugin and noticed unexpected window hiding, consider checking the plugin's documentation or temporarily disabling it to see if the behavior persists. Standard IntelliJ features, however, are well-documented and stable, making the magnet icon toggle the most reliable solution for this common usability complaint.
Frequently Asked Questions
Does disabling auto-scroll affect performance?
No, disabling the auto-scroll feature has negligible impact on IDE performance. It merely changes the UI visibility logic, preventing the interface from automatically collapsing panels. Your CPU and memory usage remain unchanged regardless of whether this setting is enabled or disabled.
Will this setting reset after an IDE update?
In most cases, your custom settings are preserved across major version updates. IntelliJ IDEA stores user preferences in a configuration directory that is migrated carefully. However, it is good practice to review your keymap and tool window settings after a major upgrade to ensure no defaults were overwritten.
How do I reopen the Project window if it is completely hidden?
If the Project window is not visible, press Alt+1 (Windows/Linux) or Command+1 (macOS). Alternatively, go to the top menu bar and select View > Tool Windows > Project. This will restore the window to its last known position.
Can I apply this setting to all projects?
Yes, the Auto-Scroll from Source setting is stored per project by default in older versions, but newer versions of IntelliJ IDEA often sync these preferences globally or allow you to export/import settings. To apply it universally, ensure you disable it in the default project template or use the Settings Sync feature if you are logged into a JetBrains account.
Why does my Terminal window still close even with auto-scroll off?
The Terminal window operates on a different logic than the Project window. It may close due to idle timeouts or specific run configurations. Check Settings > Tools > Terminal for options related to window persistence, and remember to use the Pin icon in the Terminal tab header to keep it open during development.