8000 Add documentation for `e and `u{}. by rkeithhill · Pull Request #1407 · MicrosoftDocs/PowerShell-Docs · GitHub
[go: up one dir, main page]

Skip to content

Add documentation for e and u{}. #1407

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

rkeithhill
Copy link
Contributor

This PR is tied to the acceptance of the PR PowerShell/PowerShell#3958.

Version(s) of document impacted

  • Impacts 6 document
  • Impacts 5.1 document
  • Impacts 5.0 document
  • Impacts 4.0 document
  • Impacts 3.0 document

Reason(s) for not updating all version of documents

  • The documented feature will be introduced in version 6.0 Beta4 (hopefully - waiting on PR that implements this feature to be accepted) of PowerShell
  • This issue only shows up in version (list version(s) here) of the document
  • This PR partially fixes the issue, and issue # tracks the remaining work

This PR is tied to the acceptance of the PR PowerShell/PowerShell#3958.
@msftclas
Copy link

@rkeithhill,
Thanks for having already signed the Contribution License Agreement. Your agreement was validated by Microsoft. We will now review your pull request.
Thanks,
Microsoft Pull Request Bot

@saldana
Copy link
Contributor
saldana commented Jun 27, 2017

⚠️ Validation status: warnings

File Status Preview URL Details
reference/6/About/about_Escape_Characters.md ⚠️Warning Details
reference/6/About/about_Special_Characters.md ⚠️Warning Details

reference/6/About/about_Escape_Characters.md

  • [Warning] Ignore metadata: locale. They are generated by open publish.

reference/6/About/about_Special_Characters.md

  • [Warning] Ignore metadata: locale. They are generated by open publish.

For more details, please refer to the build report.

Note: If you changed an existing file name or deleted a file, broken links in other files to the deleted or renamed file are listed only in the full build report.

@juanpablojofre juanpablojofre merged commit 3855996 into MicrosoftDocs:staging Jun 27, 2017
@@ -112,6 +133,20 @@ The output from this command is:

Column1 Column2 Column3

UNICODE CHARACTER (`u{x})
The Unicode escape sequence allows you to specify any Unicode character
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps append "by the hexadecimal representation of its code point"?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like that. I'll wait a bit, for any other updates, and submit a new PR. Thanks.

@@ -112,6 +133,20 @@ The output from this command is:

Column1 Column2 Column3

UNICODE CHARACTER (`u{x})
The Unicode escape sequence allows you to specify any Unicode character
including Unicode surrogate characters often used for Emoji e.g. `u{1F44D}.
< 10000 /path> Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps just say "including symbol characters used for emoji, e.g. `u{1F44D}."? (either way, "emoji" should be lowercase) (U+1F44D is not a surrogate character, it is a character that happens to be outside the BMP (a code point > 0xFFFF); its code-point type is Graphic, and its category is [so] (Symbol, other). In fact, there is no such thing as a surrogate character, only surrogate code points that in pairs form an assigned character.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check on lower case emoji. RE surrogate character issue, that's probably too much detail. How about something like this?

specify any Unicode character including those above the Basic Multilingual Plane (> 0xFFFF) which includes emoji characters e.g. ...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rkeithhill: Sounds great.

The Unicode escape sequence allows you to specify any Unicode character
including Unicode surrogate characters often used for Emoji e.g. `u{1F44D}.
The Unicode escape sequence requires at least one hex digit and supports
up to six hex digits. The maximum hex value is 0x10FFFF.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps say "The maximum value is `u{10FFFF}.", so as to avoid a potential distraction by 0x?


Col1 Column2 Col3
```powershell
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps choose a simpler example and one that also works in the stock macOS terminal? Something along the lines of:

$fgColor = 32 # green - see http://en.wikipedia.org/wiki/ANSI_escape_code
"It ain't easy being `e[${fgColor}mgreen`e[0m."

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought I might be overreaching a little on this example. :-) I'll revert back to a simpler (non-24 bit) sequence.

@@ -66,6 +68,25 @@ The output from this command is as follows:

back out

ESCAPE (`e)
The escape character is most commonly used to specify virtual terminal
sequences to modify the color of text in addition to other text attributes
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps identify them more accurately as ANSI escape codes?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given this PowerShell property $host.UI.SupportsVirtualTerminal and the MSDN docs, I'm inclined to leave this as-is. However I did start with ANSI escape sequences. :-)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't we have both? E.g., "virtual terminal sequences (ANSI escape sequences)"? My only concern is that "virtual terminal sequence" is a lesser-known term that seems to be primarily used in the Windows world - personally, I only recognized it because of the context here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that seems like a reasonable compromise. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants
0