Turn off iMac main screen while working on external
I succeeded by using switchresx.
Terminal command

brew cask install switchresx


then, open System Preferences, SwitchResX

Click icon, setup a display set with a disabled primary display, setup hotkey (ctrl-opt-f1 for me), save&amp;close SwitchResX

Then, if you want to use single external display mode, press the hotkey et voilà