microsoft / vscode-python

Python extension for Visual Studio Code
https://aka.ms/pvsc-marketplace
MIT License
4.28k stars 1.17k forks source link

Fix randomized shell integration decoration bug for Windows pwsh #22675

Open anthonykim1 opened 8 months ago

anthonykim1 commented 8 months ago

Reference: #22535 https://github.com/microsoft/vscode/issues/199770 This would be making changes in vscode repository for shell integration to get better sense of Python REPL '>>>' prompt.

anthonykim1 commented 7 months ago

Attempted to fix by defining Python prompt

        const pythonPrompt = lineText.match(/^(?<prompt>>>> )/g)?.groups?.prompt;
        if (pythonPrompt) {
            return {
                prompt: pythonPrompt,
                likelySingleLine: true
            };
        }

in vscode's commandDetectionCapability, but still getting colorless bubbles. Opting into windows heuristic from the Python extension side and defining Python prompt seemed to make the decoration less randomized, but still getting colorless decoration for Windows pwsh users.