2 Methods to Disable ANSI Color Escape Codes for Commands in Laravel 9

2 Methods to Disable ANSI Color Escape Codes for Commands in Laravel 9

Laravel framework provides an Artisan command line interface which is based on Symfony Console component. By default, ANSI escape codes are used to add colors to command output. Most people like this feature, but some people prefer to disable it.

This tutorial provides 2 methods how to disable ANSI color escape codes for commands in Laravel 9.

Method 1 - no-ansi option

To disable ANSI color escape codes, the --no-ansi option can be added to the command when executing it.

php artisan --no-ansi

Method 2 (Linux) - NO_COLOR before command

Define NO_COLOR environment variable when running a command.

NO_COLOR=1 php artisan

Leave a Comment

Cancel reply

Your email address will not be published.