如何在IntelliJ中固定窗口而非弹出新窗口(含Git场景)
Hey there! Let's tackle these two IntelliJ window behavior tweaks—they're small changes that make a big difference to your workflow.
1. Configure IntelliJ to use a single window instead of popping new ones
If you want all new content (projects, files, etc.) to stay in your main IntelliJ window instead of spawning separate IDE instances, follow these steps:
- Open the Settings panel: Use the shortcut
Ctrl+Alt+S(Windows/Linux) orCmd+,(Mac), or navigate via the menu bar:File > Settings(Windows/Linux) /IntelliJ IDEA > Settings(Mac). - Go to
Appearance & Behavior > System Settings. - In the Window Options section, uncheck the box labeled
Open new project in new window. - For file-specific behavior (to ensure files open in tabs rather than new windows), head to
Editor > General > Editor Tabsand make sureOpen files in new windowis not checked (this is usually default, but it's good to confirm).
Hit "Apply" and you're done—IntelliJ will keep all new content within your main window from now on.
2. Pin the "Show all affected" Git History window to the main interface
When that floating window pops up after clicking "Show all affected", you can easily attach it to your IntelliJ main interface with these quick tricks:
- Right-click directly on the title bar of the floating window.
- Select Attach to Main Window from the dropdown. The window will instantly snap into the IDE's layout, usually as a tab in the bottom or right tool window area.
- Alternatively, manually drag the floating window to the edge of your main IntelliJ window (top, bottom, left, right)—you'll see a blue highlight appear, and releasing the mouse will pin it there permanently.
If you want this to be the default for all Git-related windows, you can tweak settings in Settings > Appearance & Behavior > Menus and Toolbars: find the Git History actions and set their "Open in" option to "Main Window" instead of "New Window". But the right-click method is the fastest one-time fix.
内容的提问来源于stack exchange,提问作者Ronald

