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.

Remove ANSI colors from console output.

Andras Bacsai332a0b9e040d
diff --git a/app/Http/Livewire/Project/Shared/GetLogs.php b/app/Http/Livewire/Project/Shared/GetLogs.php
index b693793cf1..4244bed12d 100644
--- a/app/Http/Livewire/Project/Shared/GetLogs.php
+++ b/app/Http/Livewire/Project/Shared/GetLogs.php
@@ -17,7 +17,7 @@ class GetLogs extends Component
public int $numberOfLines = 100;
public function doSomethingWithThisChunkOfOutput($output)
{
- $this->outputs .= $output;
+ $this->outputs .= removeAnsiColors($output);
}
public function instantSave()
{
diff --git a/bootstrap/helpers/shared.php b/bootstrap/helpers/shared.php
index 8e8b2ec3ee..013821bd79 100644
--- a/bootstrap/helpers/shared.php
+++ b/bootstrap/helpers/shared.php
@@ -501,3 +501,6 @@ function generateDeployWebhook($resource) {
$url = $api . $endpoint . "?uuid=$uuid&force=false";
return $url;
}
+function removeAnsiColors($text) {
+ return preg_replace('/\e[[][A-Za-z0-9];?[0-9]*m?/', '', $text);
+}