src/UnixEnvironment.php
private function expandHomeDirectory(string $path): string
    {
        return getenv('HOME') . DIRECTORY_SEPARATOR . substr($path, 2, strlen($path));
    }
private function expandHomeDirectory(string $path): string
    {
        return getenv('HOME') . DIRECTORY_SEPARATOR . substr($path, 2, strlen($path));
    }
Expands home director '~/' to the full path to the home directory of the user who is executing the command.