Quantcast
Viewing all articles
Browse latest Browse all 2

Answer by joanis for Why does current/shell directory change depending whether drive-letter is used in filename?

I can't say why it happens - I've reproduced the behaviour and it is strange indeed - but here is a work-around I found:

vi -c "cd %CD%" X:\Directory\File.txt

With -c, vi will execute the cd command as soon as it opens, taking you back to the working directory you launched vi from.

Caveat: when I'm at C:\ (rather than c:\some-other-dir), I get an error message as vi starts, but the working directory is set correctly despite that error message.


Viewing all articles
Browse latest Browse all 2

Trending Articles