diff --git a/cli/valet.php b/cli/valet.php index 5e0bc48..b53b941 100755 --- a/cli/valet.php +++ b/cli/valet.php @@ -184,8 +184,8 @@ */ $app->command('open [domain]', function ($domain = null) { $url = "http://".($domain ?: Site::host(getcwd())).'.'.Configuration::read()['domain']; - - passthru("open ".escapeshellarg($url)); + // Run the 'open' command as the currently logged in user instead of root + passthru('sudo --user=`stat -f%Su /dev/console` open ' . escapeshellarg($url)); })->descriptions('Open the site for the current (or specified) directory in your browser'); /**