make iTerm work in a separate thread