-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Add documentation for e and
u{}.
#1407
Conversation
This PR is tied to the acceptance of the PR PowerShell/PowerShell#3958.
@rkeithhill, |
|
File | Status | Preview URL | Details |
---|---|---|---|
reference/6/About/about_Escape_Characters.md | Details | ||
reference/6/About/about_Special_Characters.md | 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.
@@ -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 |
There was a problem hiding this comment.
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"?
There was a problem hiding this comment.
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}. |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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. ...
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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."
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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. :-)
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
This PR is tied to the acceptance of the PR PowerShell/PowerShell#3958.
Version(s) of document impacted
Reason(s) for not updating all version of documents