diff options
Diffstat (limited to 'packages/meshbay-cli/src/meshbay_cli/commands/completion.py')
| -rw-r--r-- | packages/meshbay-cli/src/meshbay_cli/commands/completion.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/packages/meshbay-cli/src/meshbay_cli/commands/completion.py b/packages/meshbay-cli/src/meshbay_cli/commands/completion.py index 831c012..0fc3f30 100644 --- a/packages/meshbay-cli/src/meshbay_cli/commands/completion.py +++ b/packages/meshbay-cli/src/meshbay_cli/commands/completion.py @@ -51,7 +51,15 @@ Register-ArgumentCompleter -Native -CommandName 'meshbay-cli', 'meshbay-cli.exe' $index = $i } } - $found = @(& meshbay-cli __complete powershell $index @words 2>$null) + # The client writes UTF-8; Windows PowerShell reads a program's output in the + # console's code page, which turns an accented name into another name. + $encoding = [Console]::OutputEncoding + try { [Console]::OutputEncoding = [Text.Encoding]::UTF8 } catch { } + try { + $found = @(& meshbay-cli __complete powershell $index @words 2>$null) + } finally { + try { [Console]::OutputEncoding = $encoding } catch { } + } $quote = { param($s) if ($s -match '[\s''"`$&|;(){}@,#]') { "'" + ($s -replace "'", "''") + "'" } else { $s } |