selectel / pyte

Simple VTXXX-compatible linux terminal emulator
http://pyte.readthedocs.org/
GNU Lesser General Public License v3.0
653 stars 101 forks source link

Allow extra args on `Screen.erase_in_display` #108

Closed acroz closed 6 years ago

acroz commented 6 years ago

The clear implementation provided in Ubuntu sends the following control sequence:

\033[3;J\033[H\033[2J

This can be found by running:

/usr/bin/clear | sed -n l                                                                        

The first part of this sequence, \033[3;J, differs from that expected by the specification, from the sequence sent by other clear implementations, and from that expected by pyte, which is \033[3J.

The pyte Stream parser currently reads the ; and assumes there will a second argument, which defaults to 0. This 0 is passed as a second positional argument to erase_in_display, which clashes with the private keyword argument.

This PR modifies erase_in_display to accept any number of positional arguments by use of *args, while still catching private with **kwargs (though as before, private is unused.

superbobry commented 6 years ago

Thank you! Apologies for the late merge.