mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-17 09:16:11 +03:00
website: types
This commit is contained in:
@ -2,8 +2,8 @@ import VTSequence from "@/components/VTSequence";
|
|||||||
|
|
||||||
# Backspace (BS)
|
# Backspace (BS)
|
||||||
|
|
||||||
## Sequence
|
|
||||||
|
|
||||||
<VTSequence sequence="BS" />
|
<VTSequence sequence="BS" />
|
||||||
|
|
||||||
Move the cursor left one cell.
|
This sequence performs [cursor backword (CUB)](/vt/cub)
|
||||||
|
with `n = 1`. There is no additional or different behavior for
|
||||||
|
using `BS`.
|
||||||
|
7
website/app/vt/cub/page.mdx
Normal file
7
website/app/vt/cub/page.mdx
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
import VTSequence from "@/components/VTSequence";
|
||||||
|
|
||||||
|
# Cursor Backword (CUB)
|
||||||
|
|
||||||
|
<VTSequence sequence={["CSI", "n", "D"]} />
|
||||||
|
|
||||||
|
TODO
|
@ -1,6 +1,13 @@
|
|||||||
// Draw a diagram showing the VT sequence.
|
// Draw a diagram showing the VT sequence.
|
||||||
export default function VTSequence({ sequence }: { sequence: string }) {
|
export default function VTSequence({
|
||||||
const specialChar = special[sequence] ?? 0;
|
sequence,
|
||||||
|
}: {
|
||||||
|
sequence: string | [string];
|
||||||
|
}) {
|
||||||
|
// TODO: handle sequence array
|
||||||
|
const elem = typeof sequence === "string" ? sequence : sequence[0];
|
||||||
|
|
||||||
|
const specialChar = special[elem] ?? 0;
|
||||||
const hex = specialChar.toString(16).padStart(2, "0");
|
const hex = specialChar.toString(16).padStart(2, "0");
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -13,7 +20,7 @@ export default function VTSequence({ sequence }: { sequence: string }) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const special = {
|
const special: { [key: string]: number } = {
|
||||||
BEL: 0x07,
|
BEL: 0x07,
|
||||||
BS: 0x08,
|
BS: 0x08,
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user