I often use my MacBook Air (running OS X 10.9.5) closed at a docking station, where it's hooked to external monitor, keyboard/trackpad, and power. All good. The only issue is that occasionally the external power will come loose or jostle*, which turns off the external monitor or causes it to flicker. I understand the system is designed to work this way -- no external monitor when closed unless the power is plugged in.
My question is: how to change this default behavior? i.e. keep the external monitor going while closed on battery power?
[*] Why you ask? My loving, atttention-seeking cats.