Mac goes unexpected to sleep After upgrading to MacOS Catalina (10.15.1) I have had troubles with the mac going to sleep mode when i close the lid while having external monitors connected. It used to be working like this:

What happens when the lid are closed?


When no external monitor are connected: Go to sleep.
When external monitor are connected: Display content on the external monitors.


Now it just goes into sleep mode no matter which setup is used.

Can you help getting the right configuration back?
pmset is the terminal command to display all things sleep on OSX. man pmset shows you how to use the binary, pmset -g shows you the current settings.
It is possible to restore pmset to defaults by using the following commands (whilst sleep setting defaults differ from Mac to Mac, but apparently Apple have usefully made the numerical value that refers to the various profiles relatively the same.)
sudo pmset -c 2 -b 1 -u 1; pmset -g
[Sudo will require your password]
This last command from here: Default settings for pmset -g?
Another suggestion is to reset PRAM and SMC:

How to reset PRAM
1.Shut down your computer

Press the Power key
Immediately press Command + Option + P + R keys
Hold down the keys until your Mac reboots
Let go of the keys

To reset SMC

Turn off your Mac
Hold down Control + Shift + Option and press power
Hold the buttons for 10-15 sec
Release the keys and restart your Mac