-
Notifications
You must be signed in to change notification settings - Fork 657
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #688 from mitchellh/dsr
xterm audit: cursor position report (CPR)
- Loading branch information
Showing
2 changed files
with
47 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import VTSequence from "@/components/VTSequence"; | ||
|
||
# Device Status Report (DSR) | ||
|
||
<VTSequence sequence={["CSI", "Pn", "n"]} /> | ||
|
||
Request information from the terminal depending on the value of `n`. | ||
|
||
The possible valid values of `n` are described in the paragraphs below. If | ||
any other value of `n` is provided, this sequence does nothing. | ||
|
||
If `n = 5`, the _operating status_ is requested. The terminal responds | ||
to the program with `ESC [ 0 n` to indicate no malfunctions. | ||
|
||
If `n = 6`, the _cursor position_ is requested. The terminal responds to | ||
the program in the format `ESC [ y ; x R` where `y` is the row and `x` | ||
is the column, both one-indexed. If [origin mode (DEC Mode 6)](/vt/modes/origin) | ||
is enabled, the reported cursor position is relative to the top-left of the | ||
scroll region. | ||
|
||
## Validation | ||
|
||
### DSR V-1: Operating Status | ||
|
||
```bash | ||
printf "\033[1;1H" # move to top-left | ||
printf "\033[0J" # clear screen | ||
printf "\033[5n" | ||
``` | ||
|
||
``` | ||
|^[[0n_____| | ||
``` | ||
|
||
### DSR V-2: Cursor Position | ||
|
||
```bash | ||
printf "\033[1;1H" # move to top-left | ||
printf "\033[0J" # clear screen | ||
printf "\033[2;4H" # move to top-left | ||
printf "\033[6n" | ||
``` | ||
|
||
``` | ||
^[[2;4R | ||
``` |