Skip to content

Commit

Permalink
Add comments
Browse files Browse the repository at this point in the history
ONE-vscode-DCO-1.0-Signed-off-by: dayo09 <[email protected]>
  • Loading branch information
dayo09 committed Sep 7, 2022
1 parent 9f70e91 commit 4fb3617
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/View/PasswordQuickInput.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,18 @@

import * as vscode from 'vscode';

// NOTE ASCII characters have codes ranging from u+0000 to u+007f
// NOTE
//
// u+0000-u+001f: control ascii codes, ascii (ALLOWED)
// u+0020-u+007f: printable ascii codes, ascii (ALLOWED)
// u+0080-u+00ff: extended ascii codes, extended ascii (NOT ALLOWED)
//
// By experience, Linux os takes all extended ascii characters(u+0000-u+00ff) for passwords, even
// controll asciis. whereas 'eslint' recommends not using regex including control ascii codes.
// Therefore, we allow users to put control ascii codes.
//
// By experience, the passwords including extended ascii characters are not working when loging in
// to remote vscode. Therefore, here we allow only 'ascii characters'(0x00-0x7f).
function containsNonAscii(str: string): boolean {
// eslint-disable-next-line no-control-regex
return !/^[\u0000-\u007f]*$/.test(str);
Expand Down

0 comments on commit 4fb3617

Please sign in to comment.