Issues with “sequences of non-printing characters” in Readline’s variables on the Bash prompt

Im trying to customize my prompt as well as with the editing mode at the prompt. But i’m having some troubles with the non-printing characters in the variable vi-cmd-mode-string and vi-ins-mode-string.

~/.inputrc:

set show-all-if-ambiguous on
set completion-ignore-case on
set print-completions-horizontally on
set horizontal-scroll-mode on
set colored-stats on
# vi style keystrokes
set editing-mode vi
set show-mode-in-prompt on
set vi-cmd-mode-string 1e[42;30m2cmd1e[0m2
set vi-ins-mode-string 1e[43;30m2ins1e[0m2

"C-n": menu-complete
"C-p": menu-complete-backward
TAB: menu-complete

When i enter Bash it starts in insert mode, when i press Escape the place of the mode it just prints some of the characters literaly from the variables. They are enclosed between 1 and 2 so what did do wrong? Everything as i readed in the manual is right isn’t? Here is an demonstration of the issue:

issue reproduction

This just happens when I use the 1non-printable_sequence2. I’ve already enclosed all the string in quotes (") and nothing.

  • Bash version: 5.2
  • Terminal emulators: Tilix v1.9.4 and Windows Terminal v1.20.11781.0
    Both showed the same thing. Don’t think they have something to do with it.
  • OS: Ubuntu 22.04

P.S.: resizing the emulator window it works again.