mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-17 09:16:11 +03:00
website: cud
This commit is contained in:
76
website/app/vt/cud/page.mdx
Normal file
76
website/app/vt/cud/page.mdx
Normal file
@ -0,0 +1,76 @@
|
|||||||
|
import VTSequence from "@/components/VTSequence";
|
||||||
|
|
||||||
|
# Cursor Down (CUD)
|
||||||
|
|
||||||
|
<VTSequence sequence={["CSI", "Pn", "B"]} />
|
||||||
|
|
||||||
|
Move the cursor `n` cells down.
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
This sequence always unsets the pending wrap state.
|
||||||
|
|
||||||
|
If the current cursor position is at or above the [bottom margin](#TODO),
|
||||||
|
the lowest point the cursor can move is the bottom margin. If the current
|
||||||
|
cursor position is below the bottom margin, the lowest point the cursor
|
||||||
|
can move is the final row.
|
||||||
|
|
||||||
|
This sequence never triggers scrolling.
|
||||||
|
|
||||||
|
## Validation
|
||||||
|
|
||||||
|
### CUD V-1: Cursor Down
|
||||||
|
|
||||||
|
```bash
|
||||||
|
printf "A"
|
||||||
|
printf "\033[2B" # cursor down
|
||||||
|
printf "X"
|
||||||
|
```
|
||||||
|
|
||||||
|
```
|
||||||
|
|A_________|
|
||||||
|
|__________|
|
||||||
|
|_Xc_______|
|
||||||
|
```
|
||||||
|
|
||||||
|
### CUD V-2: Cursor Down Above Bottom Margin
|
||||||
|
|
||||||
|
```bash
|
||||||
|
printf "\033[1;1H" # move to top-left
|
||||||
|
printf "\033[0J" # clear screen
|
||||||
|
printf "\n\n\n\n" # screen is 4 high
|
||||||
|
printf "\033[1;3r" # set scrolling region
|
||||||
|
printf "A"
|
||||||
|
printf "\033[5B" # cursor down
|
||||||
|
printf "X"
|
||||||
|
```
|
||||||
|
|
||||||
|
```
|
||||||
|
|A_________|
|
||||||
|
|__________|
|
||||||
|
|_Xc_______|
|
||||||
|
|__________|
|
||||||
|
```
|
||||||
|
|
||||||
|
### CUD V-3: Cursor Down Below Bottom Margin
|
||||||
|
|
||||||
|
```bash
|
||||||
|
printf "\033[1;1H" # move to top-left
|
||||||
|
printf "\033[0J" # clear screen
|
||||||
|
printf "\n\n\n\n\n" # screen is 5 high
|
||||||
|
printf "\033[1;3r" # set scrolling region
|
||||||
|
printf "A"
|
||||||
|
printf "\033[4;1H" # move below region
|
||||||
|
printf "\033[5B" # cursor down
|
||||||
|
printf "X"
|
||||||
|
```
|
||||||
|
|
||||||
|
```
|
||||||
|
|A_________|
|
||||||
|
|__________|
|
||||||
|
|__________|
|
||||||
|
|__________|
|
||||||
|
|_Xc_______|
|
||||||
|
```
|
||||||
|
|
@ -45,6 +45,7 @@ function VTElem({ elem }: { elem: string }) {
|
|||||||
const special: { [key: string]: number } = {
|
const special: { [key: string]: number } = {
|
||||||
BEL: 0x07,
|
BEL: 0x07,
|
||||||
BS: 0x08,
|
BS: 0x08,
|
||||||
|
LF: 0x0a,
|
||||||
CR: 0x0d,
|
CR: 0x0d,
|
||||||
ESC: 0x1b,
|
ESC: 0x1b,
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user