55
66import six
77import sys
8+ import os
89
910from pwnlib .term import keyconsts as kc
1011from pwnlib .term import keymap as km
@@ -404,7 +405,7 @@ def readline(_size=-1, prompt='', float=True, priority=10):
404405 buffer = (buffer_left + buffer_right )
405406 if buffer :
406407 history .insert (0 , buffer )
407- return force_to_bytes (buffer )
408+ return force_to_bytes (buffer ) + b' \n '
408409 except KeyboardInterrupt :
409410 control_c ()
410411 finally :
@@ -432,7 +433,7 @@ def raw_input(prompt='', float=True):
432433 float(bool): If set to `True`, prompt and input will float to the
433434 bottom of the screen when `term.term_mode` is enabled.
434435 """
435- return readline (- 1 , prompt , float )
436+ return readline (- 1 , prompt , float ). rstrip ( os . linesep . encode ())
436437
437438def str_input (prompt = '' , float = True ):
438439 r"""str_input(prompt='', float=True)
@@ -445,7 +446,7 @@ def str_input(prompt='', float=True):
445446 float(bool): If set to `True`, prompt and input will float to the
446447 bottom of the screen when `term.term_mode` is enabled.
447448 """
448- return readline (- 1 , prompt , float ).decode ()
449+ return readline (- 1 , prompt , float ).decode (). rstrip ( os . linesep )
449450
450451def eval_input (prompt = '' , float = True ):
451452 """eval_input(prompt='', float=True)
@@ -471,7 +472,7 @@ def eval_input(prompt='', float=True):
471472 Favorite object? 20
472473 """
473474 from pwnlib .util import safeeval
474- return safeeval .const (readline (- 1 , prompt , float ))
475+ return safeeval .const (readline (- 1 , prompt , float ). rstrip ( os . linesep . encode ()) )
475476
476477def init ():
477478 global safeeval
0 commit comments