I've recently written a Console application in C# which is meant to work across OSX, Linux and Windows. Part of the application provides a bash style path auto completion (ie, where you can press tab and it does the work for you...).
It all works pretty nicely, however if the user was to enter ~/ and then press TAB, it does not understand that ~/ means the home directory.
I'm just wondering what the general opinion is of the nicest way to handle ~/ and convert it to the home directory? I've tried Path.GetFullPath() but it doesn't seem to work.
Btw I'm testing all this on OSX currently.
Edit: This is not a duplicate of the marked question, getting the home directory is easy. My question is, if someone enters a path with ~/ in it, is there some method i can feed it into that sanitises the path and removes the ~/ and possibly any other platform specific shortcuts like that.