PhpStorm terminal jumps from external monitor to default on focus, mac os x - macos

I have 2 monitors: my notebook monitor, and primary big dell monitor. PhpStorm 9.02 and MacOS X 10.10.5.
When I work at PhpStorm, I move my terminal window to secondary notebook display, and when I focus PhpStorm or terminal, terminal jumps to primary monitor. When I work with 1 tab of terminal everything looks fine after switching on Pinned mode and Floating mode at terminal settings. But today I open 3 tabs, and terminal starts jumps again.
It's very annoying when you often switch between browser and PhpStorm.
Do somebody have the same problem and fix for it?

Known bug, please vote for IDEA-116096.
See also the corresponding JDK issue:
http://bugs.openjdk.java.net/browse/JDK-8069154

Please look #lena answer and vote for issue at intellij.
I found solution thats help me to avoid terminal window jumping:
Create new tabs in terminal.
Drag it to secondary display, so they become separate window.
Close main terminal window.
Child tabs don't jumps between displays.

I solved this by changing a setting in mission control.
Just uncheck the 'Displays have separate spaces' option.
Go to System Preferences.
Click on Mission Control.
Uncheck the box marked Displays have separate spaces.
Log out an login in again.

Related

When I switch desktops in macOS with multiple displays, why is focus switching to another unexpected application (iTerm2 or VSCode in my case)?

I have a MacBook Pro running Catalina with an additional display. I typically have my development-related apps on one display (iTerm2, VSCode, etc.) and everything else on the other display (Chrome, Slack, etc.)
Sometimes (not all the time), when I switch desktops (Ctrl+left or Ctrl+right), access an app using Spotlight (Cmd+space and type), or use Cmd+Tab to switch applications, the focus would suddenly jump to iTerm2 or VSCode. This happens even if iTerm2 or VSCode isn't currently showing; for example, if I try to switch to Chrome on display 1 and iTerm2 is on a different hidden desktop on display 2, Chrome would appear on display 1 and then display 2 would show the desktop containing iTerm2 sliding into view (along with focusing iTerm2).
This severely impacts workflow, since this behavior is unpredictable and involves a lot of typing in the wrong application and reaching for the mouse. What is causing this behavior?
I found that it only happens when I have windows of the same app on both screens.
Say I switch desktop on a screen 1 and Chrome should become active there, then if I also have a Chrome window on my screen 2, it's actually the one on screen 2 that becomes active. Very frustrating..
This bug still exists in macOS Big Sur 11.4. Another symptom is that, after the erroneous focusing happens, manually switching to a space with no windows in it will leave that focused app focused, after briefly focusing Finder, rather than just focusing Finder. It's this last erroneous focusing that causes the space-switching.
Workaround: when it happens, invoke "Show All" from the menu bar (I have a keyboard shortcut for this). Note that switching to an empty space now does a single focusing of Finder, and no further space-switching happens.

On MacOS Catalina, how can I turn off yellow highlighting and popup "Look up" windows when I e.g. try to select code from Terminal?

At present, I am using a Linux VM on my Mac for certain purposes, because it is now very difficult to select and copy a segment of code from a Terminal window without some token being highlighted in yellow and a popup window with a definition etc. pops up, disrupting my effort to highlight code.
Under System Preferences, "look up" highlights Spotlight and Trackpad. Turning off Spotlight does not seem to have mitigated this behavior.
How can I copy and paste code from a Terminal window? I have a workaround for some of the issue in that I can View Page Source from Brave and select it there, but it would be really nice to have the ability to select and copy code from a Terminal window normally.
I found it here:
System Preferences > Trackpad > Turn off "Look up & data detectors"

Is there a way to use PyCharm on multiple monitors

I'm using PyCharm with multiple monitors on Mac OSX (10.10.5), normally you can drag windows off to a separate monitor. In PyCharm that works, but they (and in particular the Run window) snap back to the main monitor.
I've only seen this on the latest PyCharm 5 CE though its possible older versions also had the problem. I've searched all the settings and searched online, but can't find a setting that makes the window stay where it was placed.
Right click on the tab and select View Mode as Window.
Then you can move the window to another monitor.
It's crappy behaviour from the best python IDE out there.
There is a OSX solution but i'm not sure if you will like it:
You can enable old style multiple screen support again in OSX by going to System Preferences, Mission Control and uncheck "Displays have separate spaces". Now your floating windows will not snap back and you can even extend your PyCharm main window over the screens.
The downside of this solution is that you'll have the OSX dock and main menu only on your main monitor. I hope Jetbrains will fix this behaviour soon.
Another way to achieve what you want is to open multiple instances of the project. When you try to open the project for the second time you can choose "open project in new window". You can drag the new window to the second screen; it won't snap back to your primary monitor.
For Ubuntu and Windows users landing up here:
Press Shift + F4 or
Right-click and select 'Move Tab to New Window'
Drag the newly created window to the next screen
The best option is to detach an editor window and drag it to your second monitor.

How to make iTerm2 appear on the current screen?

Under Preferences -> 'Keys' It is possible to tick Show/hide iTerm2 with a system-wide hotkey.
However iTerm always appears on the main display (monitor) instead of where the cursor currently resides.
e.g. if I have three monitors, and am working on the third screen, the hotkey makes iTerm appear on first monitor, instead of where I am currently working.
Any advice how to solve this please?
UPDATE:
The bug strikes back again in v.3.1.6. If any workarounds are known, please share.
I'm on Sierra using iTerm 3.1 and I have the option under window to put the screen where the cursor is (bottom right drop down options). I'm using it with a hotkey.
The answer by Grant works.
The only thing you need to do is to install the beta version since there was a bug in the stable version.
This bug was fixed in 3.1.beta.1 https://iterm2.com/downloads.html
Here's the link to the latest beta version https://iterm2.com/downloads/beta/iTerm2-3_1_beta_4.zip
This may be a couple more keystrokes than you were hoping for, but if you install window management software like Size Up, you can get this working with just a few keystrokes.
Maintain your ⌥Space hotkey preference on Iterm2. Go to Size Up -> Preferences and change 'Send Window Prev Monitor' to an easy keystroke. I used ⌥1.
Now, you can do ⌥Space to get the terminal open and ⌥1 one or two times to get it to your monitor of choice. It takes a couple of key combos, but not too many!
I had this problem with macos monterey and iterm 3.4.15. I'm using the hotkey to show the terminal with slide-out window. After some search on the internet I found that disabling the option on system preferences to reopen closed documents solved the issue and the hotkey is now opening terminal on the screen with cursor as it should.
mac -> System preferences -> General -> (deselect this) Close windows when quitting an app
Neither of the above worked for me, but this helped, even though the question was quite different in that thread.

Xcode window positions when switching from dual to single monitor

When I'm working at home I plug my MacBook in to my 20" monitor as a second (right side) monitor. I do all my editing in Xcode on the larger monitor, and leave the menu bar, debugging and documentation on the laptop's monitor.
The problem is when I disconnect from the second monitor and want to work on code in "laptop" mode. Now, whenever I open a file for editing, it shows up almost entirely off the screen and I have to drag it over to edit it. I understand (sort of) why this is happening, since I last had it open in a different monitor. What I'd like to do is reset the window positions in Xcode so the edit windows show up completely on the laptop monitor. Any ideas on how to do this?
I'd even be willing to nuke entries out of the preferences (or set up an applescript to do it) but the xcode plist is inscrutable to me.
Right click the project in finder, select show package contents, and delete the two username.* files. Its not automated... but it works.
Additionally if your using some kind of version control system you probably want to add username.* to your ignore pattern.

Resources