Skip to content

An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.

fix(terminal): terminal shows that it is not available, even though it is

peaklabs-dev007e291befbf
diff --git a/app/Livewire/Project/Shared/ExecuteContainerCommand.php b/app/Livewire/Project/Shared/ExecuteContainerCommand.php
index f993480c78..98289c5365 100644
--- a/app/Livewire/Project/Shared/ExecuteContainerCommand.php
+++ b/app/Livewire/Project/Shared/ExecuteContainerCommand.php
@@ -146,11 +146,16 @@ class ExecuteContainerCommand extends Component
private function checkShellAvailability(Server $server, string $container): bool
{
$escapedContainer = escapeshellarg($container);
- $result = instant_remote_process([
- "docker exec {$escapedContainer} which bash || docker exec {$escapedContainer} which sh",
- ], $server, false);
-
- return ! empty($result);
+ try {
+ instant_remote_process([
+ "docker exec {$escapedContainer} bash -c 'exit 0' 2>/dev/null || ".
+ "docker exec {$escapedContainer} sh -c 'exit 0' 2>/dev/null",
+ ], $server);
+
+ return true;
+ } catch (\Throwable) {
+ return false;
+ }
}
#[On('connectToServer')]