`prefix` is a string and `seq` is a key sequence, so removing `len(prefix)` items from `seq` will remove too many if `prefix` contains a special character (ex "<Ctrl+x>"). Remove the number of characters from `str(seq)` instead.