~vcs-imports/screen/master

Viewing all changes in revision 1198.

  • Committer: Amadeusz Sławiński
  • Author(s): Nicolas Schodet
  • Date: 2019-02-11 20:59:43 UTC
  • Revision ID: git-v1:9b0243f7ee10cca239d8e1f65cb887e3750272a7
Fix extra characters when sending a command in one go

This closes bug #52372: Giberish printed to screen window in certain
situations.

When sending "^An", most of the time, screen first receives "^A", then
it receives the "n".  This means that in the ProcessInput2 function,
ilen == 1 after the escape character has been seen, ilen is decremented
and the ProcessInput2 function returns.

When "^An" is sent in one go, for example when pasting or when using a
special shortcut, ilen is not 1 when the escape character is seen.  In
this case, the s variable was incremented, but ilen was not decremented.
This leads the function to read an extra character which does not
exists.

This regression was introduced in 2fab4d6f73, as reported in the bug
report.

This can be tested by having a command in the selection:

echo -ne '\x01n' | xclip -i

And pasting it (in this case, you might see the closing bracketed paste
sequence, but that is another problem).

Bug: #52372
Signed-off-by: Amadeusz Sławiński <amade@asmblr.net>

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: