We now leave a potential trailing slash in the result.
This fixes the issue of the missing slash in ⌘T — while I normally prefer the slash to be stripped, I think path::with_tilde should be an exception since effectively it is just replacing the path prefix, it shouldn’t do any real processing (although we do actually normalize the string).
Also fix a bug where we would use tilde for paths pointing to a user folder for a user with current user’s name as prefix.
This is actually not entirely trivial since we can have a path that starts with a slash but includes more ‘..’ components than there are actual directories in the path.