mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-14 15:56:13 +03:00
website: ind
This commit is contained in:
@ -73,4 +73,3 @@ printf "X"
|
|||||||
|__________|
|
|__________|
|
||||||
|_Xc_______|
|
|_Xc_______|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
117
website/app/vt/ind/page.mdx
Normal file
117
website/app/vt/ind/page.mdx
Normal file
@ -0,0 +1,117 @@
|
|||||||
|
import VTSequence from "@/components/VTSequence";
|
||||||
|
|
||||||
|
# Index (IND)
|
||||||
|
|
||||||
|
<VTSequence sequence={["ESC", "D"]} />
|
||||||
|
|
||||||
|
Move the cursor down one cell, scrolling if necessary.
|
||||||
|
|
||||||
|
This sequence always unsets the pending wrap state.
|
||||||
|
|
||||||
|
If the cursor is exactly on the bottom margin and is at or within the
|
||||||
|
[left](#TODO) and [right margin](#TODO), [scroll up](#TODO) one line.
|
||||||
|
If the scroll region is the full terminal screen and the terminal is on
|
||||||
|
the [primary screen](#TODO), this may create scrollback. See the
|
||||||
|
[scroll](#TODO) documentation for more details.
|
||||||
|
|
||||||
|
If the cursor is outside of the scroll region or not on the bottom
|
||||||
|
margin of the scroll region, perform the [cursor down](/vt/cud) operation with
|
||||||
|
`n = 1`.
|
||||||
|
|
||||||
|
This sequence will only scroll when the cursor is exactly on the bottom
|
||||||
|
margin and within the remaining scroll region. If the cursor is outside
|
||||||
|
the scroll region and on the bottom line of the terminal, the cursor
|
||||||
|
does not move.
|
||||||
|
|
||||||
|
## Validation
|
||||||
|
|
||||||
|
### IND V-1: No Scroll Region, Top of Screen
|
||||||
|
|
||||||
|
```bash
|
||||||
|
printf "\033[1;1H" # move to top-left
|
||||||
|
printf "\033[0J" # clear screen
|
||||||
|
printf "A"
|
||||||
|
printf "\033D" # index
|
||||||
|
printf "X"
|
||||||
|
```
|
||||||
|
|
||||||
|
```
|
||||||
|
|A_________|
|
||||||
|
|_Xc_______|
|
||||||
|
```
|
||||||
|
|
||||||
|
### IND V-2: Bottom of Primary Screen
|
||||||
|
|
||||||
|
```bash
|
||||||
|
lines=$(tput lines)
|
||||||
|
printf "\033[1;1H" # move to top-left
|
||||||
|
printf "\033[0J" # clear screen
|
||||||
|
printf "\033[${lines};1H" # move to bottom-left
|
||||||
|
printf "A"
|
||||||
|
printf "\033D" # index
|
||||||
|
printf "X"
|
||||||
|
```
|
||||||
|
|
||||||
|
```
|
||||||
|
|A_________|
|
||||||
|
|_Xc_______|
|
||||||
|
```
|
||||||
|
|
||||||
|
### IND V-3: Inside Scroll Region
|
||||||
|
|
||||||
|
```bash
|
||||||
|
printf "\033[1;1H" # move to top-left
|
||||||
|
printf "\033[0J" # clear screen
|
||||||
|
printf "\033[1;3r" # scroll region
|
||||||
|
printf "A"
|
||||||
|
printf "\033D" # index
|
||||||
|
printf "X"
|
||||||
|
```
|
||||||
|
|
||||||
|
```
|
||||||
|
|A_________|
|
||||||
|
|_Xc_______|
|
||||||
|
```
|
||||||
|
|
||||||
|
### IND V-4: Bottom of Scroll Region
|
||||||
|
|
||||||
|
```bash
|
||||||
|
printf "\033[1;1H" # move to top-left
|
||||||
|
printf "\033[0J" # clear screen
|
||||||
|
printf "\033[1;3r" # scroll region
|
||||||
|
printf "\033[4;1H" # below scroll region
|
||||||
|
printf "B"
|
||||||
|
printf "\033[3;1H" # move to last row of region
|
||||||
|
printf "A"
|
||||||
|
printf "\033D" # index
|
||||||
|
printf "X"
|
||||||
|
```
|
||||||
|
|
||||||
|
```
|
||||||
|
|__________|
|
||||||
|
|A_________|
|
||||||
|
|_Xc_______|
|
||||||
|
|B_________|
|
||||||
|
```
|
||||||
|
|
||||||
|
### IND V-5: Bottom of Primary Screen with Scroll Region
|
||||||
|
|
||||||
|
```bash
|
||||||
|
lines=$(tput lines)
|
||||||
|
printf "\033[1;1H" # move to top-left
|
||||||
|
printf "\033[0J" # clear screen
|
||||||
|
printf "\033[1;3r" # scroll region
|
||||||
|
printf "\033[3;1H" # move to last row of region
|
||||||
|
printf "A"
|
||||||
|
printf "\033[${lines};1H" # move to bottom-left
|
||||||
|
printf "\033D" # index
|
||||||
|
printf "X"
|
||||||
|
```
|
||||||
|
|
||||||
|
```
|
||||||
|
|__________|
|
||||||
|
|__________|
|
||||||
|
|A_________|
|
||||||
|
|__________|
|
||||||
|
|Xc________|
|
||||||
|
```
|
9
website/app/vt/lf/page.mdx
Normal file
9
website/app/vt/lf/page.mdx
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
import VTSequence from "@/components/VTSequence";
|
||||||
|
|
||||||
|
# Linefeed (LF)
|
||||||
|
|
||||||
|
<VTSequence sequence="LF" />
|
||||||
|
|
||||||
|
This is an alias for [index (IND)](/vt/ind).
|
||||||
|
|
||||||
|
TODO: linefeed mode
|
Reference in New Issue
Block a user