Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Queue output not readable after update to 9.42 in PHPStorm #45200

Closed
schonhoff opened this issue Dec 6, 2022 · 8 comments
Closed

Queue output not readable after update to 9.42 in PHPStorm #45200

schonhoff opened this issue Dec 6, 2022 · 8 comments

Comments

@schonhoff
Copy link
Contributor

  • 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 #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 schonhoff changed the title Queue output not readable after update to 9.42 Queue output not readable after update to 9.42 in PHPStorm Dec 6, 2022
@nunomaduro
Copy link
Member

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

@schonhoff
Copy link
Contributor Author

schonhoff commented Dec 6, 2022

@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.

@nunomaduro nunomaduro removed their assignment Dec 6, 2022
@nunomaduro
Copy link
Member

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

@PHPGuus
Copy link
Contributor

PHPGuus commented Dec 15, 2022

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.)

@schonhoff
Copy link
Contributor Author

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?

@PHPGuus
Copy link
Contributor

PHPGuus commented Dec 16, 2022

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

@schonhoff
Copy link
Contributor Author

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
Copy link
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants