Turn shells into context managers