Skip to content

Commit

Permalink
website: ich split multi-cell
Browse files Browse the repository at this point in the history
  • Loading branch information
mitchellh committed Oct 7, 2023
1 parent f73a4f7 commit 78d69c6
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/terminal/Terminal.zig
Original file line number Diff line number Diff line change
Expand Up @@ -1620,7 +1620,9 @@ pub fn insertBlanks(self: *Terminal, count: usize) void {
while (i < copyable) : (i += 1) {
const to = right_limit - 1 - i;
const from = copyable_end - i;
row.getCellPtr(to).* = row.getCell(from);
const src = row.getCell(from);
const dst = row.getCellPtr(to);
dst.* = src;
}
}

Expand Down
25 changes: 25 additions & 0 deletions website/app/vt/ich/page.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ still reset.
Existing cells shifted beyond the right margin are deleted. Inserted cells
are blank with the background color colored according to the current SGR state.

If a multi-cell character (such as "橋") is shifted so that the cell is split
in half, the multi-cell character can either be clipped or erased. Typical
behavior is to clip at the right edge of the screen and erase at a right
margin, but either behavior is acceptable.

## Validation

### ICH V-1: No Scroll Region, Fits on Screen
Expand Down Expand Up @@ -101,3 +106,23 @@ printf "X"
```
|XcABC_____|
```

### ICH V-6: Split Wide Character

```bash
cols=$(tput cols)
printf "\033[${cols}G"
printf "\033[1D"
printf ""
printf "\033[2D"
printf "\033[@"
printf "X"
```

```
|_______Xc_|
```

In this case, it is valid for the last cell to be blank or to clip the
multi-cell character. xterm clips the character but many other terminals
erase the cell.

0 comments on commit 78d69c6

Please sign in to comment.