public function getBinary()
    {
        $default = $this->binary;

        // Resolve true path to binary
        if (!$this->resolved) {
            $paths = $this->getKnownPaths() ?: [$default];
            if ($this->connections->getCurrentConnectionKey() && $paths) {
                $binary = Arr::get($paths, 0);
                $fallback = Arr::get($paths, 1);
                $this->setBinary($this->bash->which($binary, $fallback, false));
            } elseif ($paths) {
                $this->setBinary($paths[0]);
            }
        }

        return $this->binary ?: $default;
    }