Skip to content

Unexpectedly changed the output code page when calling the ssh, ssh-keygen, scp, sftp command. #2027

Closed
@kemaruya

Description

@kemaruya

Prerequisites

  • Write a descriptive title.
  • Make sure you are able to repro it on the latest version
  • Search the existing issues.

Steps to reproduce

Open command prompt and just run scp, sftp, ssh or ssh-keygen command.

Expected behavior

Keep previews output codepage between before execute scp, sftp, ssh or ssh-keygen command.

----
Microsoft Windows [Version 10.0.20348.169]
(c) Microsoft Corporation. All rights reserved.
 
C:\Users\Administrator>chcp
現在のコード ページ: 932 << Output Language is Japanese (CP932)
 
C:\Users\Administrator>ssh
usage: ssh [-46AaCfGgKkMNnqsTtVvXxYy] [-B bind_interface]
           [-b bind_address] [-c cipher_spec] [-D [bind_address:]port]
           [-E log_file] [-e escape_char] [-F configfile] [-I pkcs11]
           [-i identity_file] [-J [user@]host[:port]] [-L address]
           [-l login_name] [-m mac_spec] [-O ctl_cmd] [-o option] [-p port]
           [-Q query_option] [-R address] [-S ctl_path] [-W host:port]
           [-w local_tun[:remote_tun]] destination [command]
 
C:\Users\Administrator>chcp
現在のコード ページ: 932 << Output Language is still Japanese (CP932)
 
C:\Users\Administrator>

Actual behavior

The output codepage has been changed to UTF8 (65001) after execute scp, sftp, ssh or ssh-keygen command.

----
Microsoft Windows [Version 10.0.20348.169]
(c) Microsoft Corporation. All rights reserved.
 
C:\Users\Administrator>chcp
現在のコード ページ: 932 << Output Language is Japanese (CP932)
 
C:\Users\Administrator>ssh
usage: ssh [-46AaCfGgKkMNnqsTtVvXxYy] [-B bind_interface]
           [-b bind_address] [-c cipher_spec] [-D [bind_address:]port]
           [-E log_file] [-e escape_char] [-F configfile] [-I pkcs11]
           [-i identity_file] [-J [user@]host[:port]] [-L address]
           [-l login_name] [-m mac_spec] [-O ctl_cmd] [-o option] [-p port]
           [-Q query_option] [-R address] [-S ctl_path] [-W host:port]
           [-w local_tun[:remote_tun]] destination [command]
 
C:\Users\Administrator>chcp
Active code page: 932 << Output Language has been changed to UTF8 (CP65001)
 
C:\Users\Administrator>

Error details

No response

Environment data

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

Version

9.1.0.0

Visuals

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions