diff --git a/website/app/vt/cub/page.mdx b/website/app/vt/cub/page.mdx index e9e146bd7..49e761c67 100644 --- a/website/app/vt/cub/page.mdx +++ b/website/app/vt/cub/page.mdx @@ -42,9 +42,11 @@ mode. For the **reverse wrap** (non-extended) behavior, moe the cursor to the left `n` cells while respecting the aforementioned leftmost boundary. Upon reaching the -leftmost boundary, if `n > 0` then move the cursor to the [right margin](#TODO) -of the line above the cursor. If the cursor is already on the -[top margin](#TODO), do not move the cursor up and the sequence is complete. +leftmost boundary, if `n > 0` and the previous line was wrapped, then move the +cursor to the [right margin](#TODO) of the line above the cursor. If the previous +line was not wrapped, the cursor left operation is complete even if there +is a remaining value of `n`. If the cursor +is already on the [top margin](#TODO), do not move the cursor up. This wrapping mode does not wrap the cursor row back to the bottom margin. ## Validation @@ -79,4 +81,23 @@ printf "B" |Bc________| ``` +### CUB V-3: Reverse Wrap + +```bash +cols=$(tput cols) +printf "\033[?7h" # enable wraparound +printf "\033[?45h" # enable reverse wrap +printf "\033[1;1H" # move to top-left +printf "\033[0J" # clear screen +printf "\033[${cols}G" # move to end of line +printf "AB" # write and wrap +printf "\033[D" # move back two +printf "X" +``` + +``` +|_________Xc +|B_________| +``` + ### TODO: Reverse Wrap, Scroll Region Validations