-
Notifications
You must be signed in to change notification settings - Fork 631
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 #870 from mitchellh/xt
xterm audit: DEC mode 3 (DECCOLM), 4 (DECSCLM), 40 (132COLS)
- Loading branch information
Showing
5 changed files
with
190 additions
and
22 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
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,70 @@ | ||
import VTMode from "@/components/VTMode"; | ||
|
||
# Select 80 or 132 Columns per Page (DECCOLM) | ||
|
||
<VTMode value={3} /> | ||
|
||
Sets the screen to 132 columns if set or 80 columns if unset. | ||
|
||
This requires [`132COLS` (DEC mode 40)](/vt/modes/132cols) to be set | ||
to have any effect. If `132COLS` is not set, then setting or unsetting | ||
this mode does nothing. | ||
|
||
When this mode changes, the screen is resized to the given column amount, | ||
performing reflow if necessary. If the GUI window is too narrow or too wide, | ||
it is typically resized to fit the explicit column count or a scrollbar is | ||
used. If the GUI window is manually resized (i.e. with the mouse), the column | ||
width of DECCOLM is not enforced. | ||
|
||
The scroll margins are reset to their default values given the new screen size. | ||
The cursor is moved to the top-left. The screen is erased using | ||
[erase display (ED) with command 2](/vt/ed). | ||
|
||
## Validation | ||
|
||
### DECCOLM V-1: Disabled | ||
|
||
```bash | ||
printf "ABC\n" | ||
printf "\033[?40l" # disable mode 3 | ||
printf "\033[?3h" | ||
printf "X" | ||
``` | ||
|
||
``` | ||
|ABC_____| | ||
|Xc______| | ||
|________| | ||
``` | ||
|
||
The command should be completely ignored. | ||
|
||
### DECCOLM V-2: Unset (80 Column) | ||
|
||
```bash | ||
printf "ABC\n" | ||
printf "\033[?40h" # enable mode 3 | ||
printf "\033[?3l" # unset the mode | ||
printf "X" | ||
``` | ||
|
||
``` | ||
|X_______| | ||
``` | ||
|
||
The screen should be 80 columns wide. | ||
|
||
### DECCOLM V-3: Set (132 Column) | ||
|
||
```bash | ||
printf "ABC\n" | ||
printf "\033[?40h" # enable mode 3 | ||
printf "\033[?3h" | ||
printf "X" | ||
``` | ||
|
||
``` | ||
|X_______| | ||
``` | ||
|
||
The screen should be 132 columns wide. |
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,12 @@ | ||
import VTMode from "@/components/VTMode"; | ||
|
||
# Slow Scroll (DECSCLM) | ||
|
||
<VTMode value={4} /> | ||
|
||
Enable slow or smooth scrolling. | ||
|
||
Typically, slow scrolling will scroll line by line when using scroll | ||
functions (arrow keys, scrollbar, etc.). With this disabling, scrolling | ||
jumps by more lines. This is purely up to the terminal to implement how it | ||
sees fit. |
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,11 @@ | ||
import VTMode from "@/components/VTMode"; | ||
|
||
# Reverse Video (DECSCNM) | ||
|
||
<VTMode value={5} /> | ||
|
||
Swap the foreground/background colors of cells. | ||
|
||
This swaps the foreground and background color of cells when displayed. | ||
This does not physically alter the cell state or cell contents; only the | ||
rendered state is affected. |