mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-08-02 14:57:31 +03:00
website: start cr
This commit is contained in:
36
website/app/vt/cr/page.mdx
Normal file
36
website/app/vt/cr/page.mdx
Normal file
@ -0,0 +1,36 @@
|
||||
import VTSequence from "@/components/VTSequence";
|
||||
|
||||
# Carriage Return (CR)
|
||||
|
||||
<VTSequence sequence="CR" />
|
||||
|
||||
Move the cursor to the leftmost column.
|
||||
|
||||
This sequence always unsets the pending wrap state.
|
||||
|
||||
If [origin mode (mode 6)](#TODO) is enabled, the cursor is set to the
|
||||
[left margin](#TODO) of the scroll region and the operation is complete.
|
||||
|
||||
If origin mode is _not_ set and the cursor is on or to the right of the
|
||||
left margin, the cursor is set to the left margin. If the cursor is to the left
|
||||
of the left margin, the cursor is moved to the leftmost column in the terminal.
|
||||
|
||||
## Validation
|
||||
|
||||
### CR V-1: Pending Wrap is Unset
|
||||
|
||||
```bash
|
||||
cols=$(tput cols)
|
||||
printf "\033[${cols}G" # move to last column
|
||||
printf "A" # set pending wrap state
|
||||
printf "\r"
|
||||
printf "X"
|
||||
echo
|
||||
```
|
||||
|
||||
```
|
||||
|X________A|
|
||||
|c_________|
|
||||
```
|
||||
|
||||
### TODO: left/right margins
|
@ -143,3 +143,4 @@ printf "X"
|
||||
|B_________|
|
||||
|_________Xc
|
||||
``g
|
||||
```
|
||||
|
@ -45,5 +45,6 @@ function VTElem({ elem }: { elem: string }) {
|
||||
const special: { [key: string]: number } = {
|
||||
BEL: 0x07,
|
||||
BS: 0x08,
|
||||
CR: 0x0d,
|
||||
ESC: 0x1b,
|
||||
};
|
||||
|
Reference in New Issue
Block a user