input: be more strict in recognizing certain escape sequences

Accept the "Esc [ 1 n ~" and "Esc [ 2 n ~" sequences only when they
end with the "~" character, not with any character.
1 file changed