Change subprocess call, selective escape disabling

- The escape character is now disabled only when a TTY is not allocated.
- The subprocess call is no longer wrapped in a loop.