-
Notifications
You must be signed in to change notification settings - Fork 572
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
119 additions
and
3 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,70 @@ | ||
import VTSequence from "@/components/VTSequence"; | ||
|
||
# Cursor Horizontal Tabulation (CHT) | ||
|
||
<VTSequence sequence={["CSI", "Pn", "I"]} /> | ||
|
||
Move the cursor `n` tabs right. | ||
|
||
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 rightmost valid column for this operation is the rightmost column in | ||
the terminal screen or the [right margin](#TODO), whichever is smaller. | ||
This sequence does not change behavior with [origin mode](#TODO) set. | ||
|
||
Move the cursor right until the cursor position is on a tabstop. If the | ||
cursor would move past the rightmost valid column, the cursor remains at | ||
the rightmost valid column and the operation completes. Repeat this process | ||
`n` times. | ||
|
||
Tabstops are dynamic and can be set with escape sequences such as | ||
[horizontal tab set (HTS)](/vt/hts), [tab clear (TBC)](/vt/tbc), etc. | ||
A terminal emulator may default tabstops at any interval, though an interval | ||
of 8 spaces is most common. | ||
|
||
## Validation | ||
|
||
### CHT V-1: Right Beyond Last Column | ||
|
||
```bash | ||
printf "\033[?W" # reset tab stops | ||
printf "\033[100I" # assuming the test terminal has less than 800 columns | ||
printf "A" | ||
``` | ||
|
||
``` | ||
|_________A| | ||
``` | ||
|
||
### CHT V-2: Right From Before a Tabstop | ||
|
||
```bash | ||
printf "\033[?W" # reset tab stops | ||
printf "\033[1;2H" | ||
printf "A" | ||
printf "\033[I" | ||
printf "X" | ||
``` | ||
|
||
``` | ||
|_A_____X__| | ||
``` | ||
|
||
### CHT V-3: Right Margin | ||
|
||
```bash | ||
printf "\033[1;1H" # move to top-left | ||
printf "\033[0J" # clear screen | ||
printf "\033[?W" # reset tab stops | ||
printf "\033[?69h" # enable left/right margins | ||
printf "\033[3;6s" # scroll region left/right | ||
printf "\033[1;1H" # move cursor in region | ||
printf "X" | ||
printf "\033[I" | ||
printf "A" | ||
``` | ||
|
||
``` | ||
|__AX______| | ||
``` |
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,8 @@ | ||
import VTSequence from "@/components/VTSequence"; | ||
|
||
# Tab (TAB) | ||
|
||
<VTSequence sequence="TAB" /> | ||
|
||
This is an alias for [cursor horizontal tabulation (CHT)](/vt/cht) with | ||
`n = 1`. |
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