framework icon indicating copy to clipboard operation
framework copied to clipboard

Queue output not readable after update to 9.42 in PHPStorm

Open schonhoff opened this issue 3 years ago • 3 comments

  • Laravel Version: 9.42.2
  • PHP Version: 8.1.9
  • Database Driver & Version: MySQL 8.0.28
  • IDE: PHPStorm 2022.2.4
  • OS: Windows 10

Description:

Hello,

after upgrading Laravel localy to version 9.42 from 9.39 the queue:work command is not rendered correctly in PHPStorm. Either cmd nor powershell can be used for it because it can not be read. I'm fine with it but PHPStorm should work as an IDE and it worked before. My guess is is the PR https://github.com/laravel/framework/pull/44971 that broke it. Before I updated it looked like the screenshots in the PR. I hope this can be fixed. If more information is required I will try to provide them.

Screenshot PHPSotrm

Laravel queue worker output error

Screenshot CMD

image

schonhoff avatar Dec 06 '22 12:12 schonhoff

@schonhoff If you revert to 9.41, does it work as expected?

nunomaduro avatar Dec 06 '22 15:12 nunomaduro

@nunomaduro I reverted back to 9.41: image

And also reverted back to 9.40.1: image

The 9.40.1 is working like a charm. All versions above this version aren't working correctly.

I also tried out 4 different computer (all Windows 10) and 3 different PHPStorm versions. All have the same display error.

schonhoff avatar Dec 06 '22 17:12 schonhoff

@PHPGuus You think you can try to reproduce this issue locally? Or assist this customer? For info, this change (https://github.com/laravel/framework/pull/44971) was released 14 days ago (9.41), and it should not cause any issues like the one the customer is describing.

nunomaduro avatar Dec 06 '22 17:12 nunomaduro

I've tried this under VSCode against Laravel 9.43.0, 9.42.2, 9.41.0 and 9.40.1 - all work well in a Windows 10 system with the Latin 1 code page (850 - OEM Multilingual Latin 1; Western European (DOS)) in both PowerShell and CMD prompt.

There is one difference between 9.40.1 and 9.41.0: 9.40.1 outputs the start of the line (2022-12-15 12:15:56 App\Jobs\ProcessPayment) and then only reports the finish when it is done including the durationm whereas 9.41.0 and above report two lines: First line the Job and the status RUNNING, the second line Job and the duration.

What codepage is running on your Windows System, @schonhoff ? (Run chcp in PowerShell or CMD Prompt to find out.)

PHPGuus avatar Dec 15 '22 12:12 PHPGuus

Hi @PHPGuus,

output of the chcp on a CMD Promp: Aktive Codepage: 850.

I'm using PHPStorm and not VSCode, can that make a differnece?

This is one of my PHPStorm installations:

PhpStorm 2022.3
Build #PS-223.7571.212, built on December 1, 2022
Licensed to xxxxxxxxxxxxxxx
Subscription is active until October 16, 2023.
Runtime version: 17.0.5+1-b653.14 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Windows 10 10.0
GC: G1 Young Generation, G1 Old Generation
Memory: 4064M
Cores: 16
Registry:
    debugger.new.tool.window.layout=true
    run.processes.with.pty=TRUE
    ide.experimental.ui=true

Non-Bundled Plugins:
    com.mnr.java.intellij.idea.plugin.base64helper (2.0.3)
    org.intellij.plugins.postcss (223.7571.117)
    com.intellij.ideolog (203.0.30.0)
    Statistic (4.2.6)
    com.github.inxilpro.intellijalpine (v0.4.2)
    ru.adelf.idea.dotenv (2022.3)
    de.espend.idea.php.annotation (8.3.0)
    de.beyondco.tinkerwell.tinkerwell (2.0)
    com.laravel_idea.plugin (6.2.2.223)
    com.pestphp.pest-intellij (1.8.3)
    zielu.gittoolbox (213.10.3)

Still no changes after updating from PHPStorm 2022.2.4 to 2022.3 .

I did some changes to my vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php and reverted line after line back to track down the issue. After I changed this line:

        if (Terminal::hasSttyAvailable()) {
            $this->components->info(
                sprintf('Processing jobs from the [%s] %s.', $queue, str('queue')->plural(explode(',', $queue)))
            );
        }

to not use the if statement, the console output was fine again. No other change was made to the code. Only the if statement needs to be commented out. What do I need to change for the if statement?

schonhoff avatar Dec 15 '22 12:12 schonhoff

Hi @schonhoff

I have this PhpStorm: PhpStorm 2022.3 Build #PS-223.7571.212, built on December 1, 2022 Licensed to Guus Leeuw Subscription is active until January 14, 2023. Evaluation purpose only. Runtime version: 17.0.5+1-b653.14 amd64 VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o. Windows 10 10.0 GC: G1 Young Generation, G1 Old Generation Memory: 750M Cores: 8 Registry: run.processes.with.pty=TRUE

And in that PhpStorm, the PowerShell and the CMD Prompt both display the output properly for the 4 version I mentioned earlier.

Which display language is active in Windows for you? I have "English (United States)". I still suspect some character class collision somewhere, that is possibly triggered by the Terminal class doing its investigation...

Can you run stty in PowerShell or CMD prompt? On my Windows 10 box, that command doesn't exist.

Best regards, Guus

PHPGuus avatar Dec 16 '22 07:12 PHPGuus

Hi @PHPGuus,

our display language is German (Germany)/Deutsch (Deutschland). But a college tested it with English (United Kingdom) as the display language and has the same errors.

Output of stty in PHPStorm, CMD and Powershell (same for my college):

speed 38400 baud; line = 0;  
-imaxbel iutf8

The stty command is only available because we need to use Git for windows (and it includes this command). The version is git version 2.31.1.windows.1

My Powershell version with $PSVersionTable (same for my college):

Name                           Value
----                           -----
PSVersion                      5.1.19041.2364
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.19041.2364
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

schonhoff avatar Dec 16 '22 10:12 schonhoff

Hi @PHPGuus,

I fixed the problem. My GIT for Windows version needs to be 2.38.1 or 2.39 because the stty.exe could not handle something from the Termwind extension (my guess). Now it is working all fine. Thanks for the help! You got me on the right track.

schonhoff avatar Dec 19 '22 06:12 schonhoff