diff --git a/src/terminal/Terminal.zig b/src/terminal/Terminal.zig index 1907f97f2..54ee0598c 100644 --- a/src/terminal/Terminal.zig +++ b/src/terminal/Terminal.zig @@ -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; } } diff --git a/website/app/vt/ich/page.mdx b/website/app/vt/ich/page.mdx index 40a520cf0..5586757d6 100644 --- a/website/app/vt/ich/page.mdx +++ b/website/app/vt/ich/page.mdx @@ -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 @@ -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.