X-Git-Url: https://mudpy.org/gitweb?p=mudpy.git;a=blobdiff_plain;f=mudpy%2Ftelnet.py;h=ec18f70a64e0881671f1880da6ddbe61c2732d7b;hp=35fb1c697290f7b86e97cbca155fd25b7aa69069;hb=29041014a531835bf9b6a80ca9d7ed414a929432;hpb=7aa0e226d74b56f955cb328d5e7f03d7d3d32efb diff --git a/mudpy/telnet.py b/mudpy/telnet.py index 35fb1c6..ec18f70 100644 --- a/mudpy/telnet.py +++ b/mudpy/telnet.py @@ -188,7 +188,7 @@ def negotiate_telnet_options(user): # make a local copy to play with text = user.partial_input - # start at the begining of the input + # start at the beginning of the input position = 0 # as long as we haven't checked it all @@ -269,6 +269,8 @@ def negotiate_telnet_options(user): if telopt is TELOPT_NAWS: user.columns = ( text[position + 3] * 256 + text[position + 4]) + user.rows = ( + text[position + 5] * 256 + text[position + 6]) elif telopt is TELOPT_TTYPE and text[position + 3] is IS: user.ttype = ( text[position + 4:end_subnegotiation]).decode("ascii") @@ -281,7 +283,7 @@ def negotiate_telnet_options(user): log("Ignored unknown command %s from" % command, user) text = text[:position] + text[position + 2:] - # and this means we got the begining of an IAC + # and this means we got the beginning of an IAC else: position += 1