How to get the current location of the terminal