A shoulder holster should be all that is necessary to store a firearm while in the cockpit. The concern for armed pilots in the terminals is real, and can be remedied by allowing pilots to be armed only between departure dispatch/ops and destination dispatch/ops. Guns would be stored in company safes at all other times. Pilots always have to pick-up a dispatch-release. They would just be adding the pick-up of a sidearm, if desired.
All armed personnel on an airplane should always know the status of each other. Regular passengers should only assume there are arms on the airplane.