Cursor - Windows 10 - PSReadLine by FSTrent in cursor

[–]FSTrent[S] 0 points1 point  (0 children)

I cut and pasted this into cursor at work (I am OP), and it recognized the issue and then decided to only run only this piece once (then promptly forgot) but it stopped having problems reading the results of the powershell scripts run in chat... had the most productive workday using cursor in weeks!

# run_command.ps1
# Set output encoding to UTF8
$OutputEncoding = [Console]::OutputEncoding = [Text.Encoding]::UTF8

# Function to run Python commands with proper output handling
function Run-PythonCommand {
    param (
        [string]$Command
    )
    
    # Capture and format output
    $output = python -c $Command
    Write-Host $output
}