based on https://github.com/toddmotto/fireshell