Repository navigation
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -29,10 +29,12 @@ The following special characters are recognized by Windows PowerShell: | |
| `0 Null | ||
| `a Alert | ||
| `b Backspace | ||
| `e Escape | ||
| `f Form feed | ||
| `n New line | ||
| `r Carriage return | ||
| `t Horizontal tab | ||
| `u{x} Unicode escape sequence | ||
| `v Vertical tab | ||
| --% Stop parsing | ||
|
|
||
|
|
@@ -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 | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Perhaps identify them more accurately as ANSI escape codes?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Given this PowerShell property
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, that seems like a reasonable compromise. Thanks. |
||
| such as bolding and underlining as well as moving the cursor. The PowerShell | ||
| host must support virtual terminal sequences. Windows 10 v1511 and higher, | ||
| as well as most Linux and macOS terminals support virtual terminal sequences. | ||
|
|
||
| The following command outputs Orange text. This requires a host capable | ||
| of 24-bit color such as Windows 10 Anniversary Update or higher: | ||
|
|
||
| $r,$g,$b = 0xff,0x66,0x00 | ||
|
|
||
| "`e[38;2;$r;$g;${b}mOrange text`e[0m" | ||
|
|
||
| The output from this command is the following text with a foreground color | ||
| of Orange: | ||
|
|
||
| Orange text | ||
|
|
||
| FORM FEED (`f) | ||
| The form feed character (`f) is a print instruction that ejects the | ||
| current page and continues printing on the next page. This character | ||
|
|
@@ -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 | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Perhaps append "by the hexadecimal representation of its code point"?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
| including Unicode surrogate characters often used for Emoji e.g. `u{1F44D}. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Perhaps just say "including symbol characters used for emoji, e.g.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Keith Hill (@rkeithhill): Sounds great. |
||
| The Unicode escape sequence requires at least one hex digit and supports | ||
| up to six hex digits. The maximum hex value is 0x10FFFF. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Perhaps say "The maximum value is |
||
|
|
||
| The following command outputs the character '↕': | ||
|
|
||
| "`u{2195}" | ||
|
|
||
| The output from this command is: | ||
|
|
||
| ↕ | ||
|
|
||
| VERTICAL TAB (`v) | ||
| The horizontal tab character (`t) advances to the next vertical tab stop | ||
| and writes all subsequent output beginning at that point. This 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 choose a simpler example and one that also works in the stock macOS terminal? Something along the lines of:
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.