Search code examples
laraveltinker

Laravel "artisan tinker" stops with a colon (:)


enter image description here

When a lot of text is printed (example User::all()), old tinker v2.7.1 prints all data. The new tinker stops with a colon (:). Is there a way to return the old behavior?


Solution

  • Tinker uses Psysh.

    Psysh has a config option for setting pager.

    From https://github.com/bobthecow/psysh/wiki/Config-options

    If this is not set, it falls back to less. It is recommended that you set up cli.pager in your php.ini with your preferred output pager.

    For anything more than one page long, less will interrupt output with a colon.

    I fixed this by switching the pager to 'cat'.

    To update psysh options for tinker, create a .psysh.php file in the laravel project root directory and throw this in it:

    <?php
    
    return [
        'pager' => "cat"
    ];
    

    Now when you run tinker, you'll get uninterrupted output (like it used to be).