To simplify the problem, run following command will get the same error
:py3 print(vim.eval('"\\<bs>"'))
And the real situation is
while 1:
vimcmd("let nr = getchar()")
vimcmd("let ch = type(nr) ? nr : nr2char(nr)")
if vimeval('ch == "\\<bs>"') == '1':
dosomething
...
:h Linux-backspace...? – B Layer Dec 21 '20 at 12:33:h :fixdeland this from Vim wiki: https://vim.fandom.com/wiki/Backspace_and_delete_problems . ... perhaps some clues can be found there. – B Layer Dec 21 '20 at 12:41:py3 print(vim.eval('"\\<bs>"'))and what is the result? – ZhiyuanLck Dec 21 '20 at 13:11"\<bs>"still raises an error (although a bit different). And the OP is interested in handling a string containing"\<bs>". – user938271 Dec 21 '20 at 15:45