I also had the same issues and finally managed to crack it last night.
In my instance I'm managing a Drupal 8 website and needed to use composer and drush to update libraries and configuration after a deployment.
The first thing I figured out is the directory you start in is your deployment...