Skip to content

DCH — Delete Characters

SequenceCSI <n> P
Bytes0x1B 0x5B <n> 0x50
MnemonicDCH
Otty support

Description

Deletes <n> cells starting at the cursor, shifting remaining cells in the row to the left. Cells on the right are filled with blanks.

Default <n> = 1. Cursor position is unchanged.

Example

bash
printf 'abcdef\e[H'     # write text, move home
printf '\e[2P'          # delete 2 chars at col 1
# row now reads "cdef  "
  • ICH
  • EL — erase rather than delete (keeps trailing cells unshifted).

Otty