-
Notifications
You must be signed in to change notification settings - Fork 644
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #655 from mitchellh/xterm-stuff
xterm audit: CNL, CPL, NEL, RI, HTS
- Loading branch information
Showing
5 changed files
with
300 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import VTSequence from "@/components/VTSequence"; | ||
|
||
# Cursor Next Line (CNL) | ||
|
||
<VTSequence sequence={["CSI", "Pn", "E"]} /> | ||
|
||
Move the cursor `n` cells down and to the beginning of the line. | ||
|
||
The parameter `n` must be an integer greater than or equal to 1. If `n` is less than | ||
or equal to 0, adjust `n` to be 1. If `n` is omitted, `n` defaults to 1. | ||
|
||
The logic of this sequence is identical to [Cursor Down (CUD)](/vt/cud) | ||
followed by [Carriage Return (CR)](/vt/cr). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import VTSequence from "@/components/VTSequence"; | ||
|
||
# Cursor Previous Line (CPL) | ||
|
||
<VTSequence sequence={["CSI", "Pn", "F"]} /> | ||
|
||
Move the cursor `n` cells up and to the beginning of the line. | ||
|
||
The parameter `n` must be an integer greater than or equal to 1. If `n` is less than | ||
or equal to 0, adjust `n` to be 1. If `n` is omitted, `n` defaults to 1. | ||
|
||
The logic of this sequence is identical to [Cursor Up (CUU)](/vt/cuu) | ||
followed by [Carriage Return (CR)](/vt/cr). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,138 @@ | ||
import VTSequence from "@/components/VTSequence"; | ||
|
||
# Reverse Index (RI) | ||
|
||
<VTSequence sequence={["ESC", "M"]} /> | ||
|
||
Move the cursor up one cell, scrolling if necessary. | ||
|
||
This sequence does not unset the pending wrap state. | ||
|
||
If the cursor is exactly on the [top margin](/vt/decstbm) and is within | ||
[left and right margins](/vt/decslrm), invoke [scroll down (SD)](/vt/sd) | ||
with `n = 1`. The operation is complete. | ||
|
||
Otherwise, scrolling isn't necessary. Perform a | ||
[cursor up](/vt/cuu) operation with `n = 1`. | ||
|
||
## Validation | ||
|
||
### RI V-1: No Scroll Region, Top of Screen | ||
|
||
```bash | ||
printf "\033[1;1H" # move to top-left | ||
printf "\033[0J" # clear screen | ||
printf "A\n" | ||
printf "B\n" | ||
printf "C\n" | ||
printf "\033[1;1H" # move to top-left | ||
printf "\033M" # reverse index | ||
printf "X" | ||
``` | ||
|
||
``` | ||
|Xc________| | ||
|A_________| | ||
|B_________| | ||
|C_________| | ||
``` | ||
|
||
### RI V-2: No Scroll Region, Not Top of Screen | ||
|
||
```bash | ||
printf "\033[1;1H" # move to top-left | ||
printf "\033[0J" # clear screen | ||
printf "A\n" | ||
printf "B\n" | ||
printf "C\n" | ||
printf "\033[2;1H" | ||
printf "\033M" # reverse index | ||
printf "X" | ||
``` | ||
|
||
``` | ||
|Xc________| | ||
|B_________| | ||
|C_________| | ||
``` | ||
|
||
### RI V-3: Top/Bottom Scroll Region | ||
|
||
```bash | ||
printf "\033[1;1H" # move to top-left | ||
printf "\033[0J" # clear screen | ||
printf "A\n" | ||
printf "B\n" | ||
printf "C\n" | ||
printf "\033[2;3r" # scroll region | ||
printf "\033[2;1H" | ||
printf "\033M" # reverse index | ||
``` | ||
|
||
``` | ||
|A_________| | ||
|c_________| | ||
|B_________| | ||
``` | ||
|
||
### RI V-4: Outside of Top/Bottom Scroll Region | ||
|
||
```bash | ||
printf "\033[1;1H" # move to top-left | ||
printf "\033[0J" # clear screen | ||
printf "A\n" | ||
printf "B\n" | ||
printf "C\n" | ||
printf "\033[2;3r" # scroll region | ||
printf "\033[1;1H" | ||
printf "\033M" # reverse index | ||
``` | ||
|
||
``` | ||
|A_________| | ||
|B_________| | ||
|C_________| | ||
``` | ||
|
||
### RI V-5: Left/Right Scroll Region | ||
|
||
```bash | ||
printf "\033[1;1H" # move to top-left | ||
printf "\033[0J" # clear screen | ||
printf "ABC\n" | ||
printf "DEF\n" | ||
printf "GHI\n" | ||
printf "\033[?69h" # enable left/right margins | ||
printf "\033[2;3s" # scroll region left/right | ||
printf "\033[1;2H" | ||
printf "\033M" | ||
``` | ||
|
||
``` | ||
|A_________| | ||
|DBC_______| | ||
|GEF_______| | ||
|_HI_______| | ||
``` | ||
|
||
### RI V-6: Outside Left/Right Scroll Region | ||
|
||
```bash | ||
printf "\033[1;1H" # move to top-left | ||
printf "\033[0J" # clear screen | ||
printf "ABC\n" | ||
printf "DEF\n" | ||
printf "GHI\n" | ||
printf "\033[?69h" # enable left/right margins | ||
printf "\033[2;3s" # scroll region left/right | ||
printf "\033[2;1H" | ||
printf "\033M" | ||
``` | ||
|
||
``` | ||
|ABC_______| | ||
|DEF_______| | ||
|GHI_______| | ||
``` | ||
|
||
Cursor on the `A`. |