5
5
6
6
import six
7
7
import sys
8
+ import os
8
9
9
10
from pwnlib .term import keyconsts as kc
10
11
from pwnlib .term import keymap as km
@@ -404,7 +405,7 @@ def readline(_size=-1, prompt='', float=True, priority=10):
404
405
buffer = (buffer_left + buffer_right )
405
406
if buffer :
406
407
history .insert (0 , buffer )
407
- return force_to_bytes (buffer )
408
+ return force_to_bytes (buffer ) + b' \n '
408
409
except KeyboardInterrupt :
409
410
control_c ()
410
411
finally :
@@ -432,7 +433,7 @@ def raw_input(prompt='', float=True):
432
433
float(bool): If set to `True`, prompt and input will float to the
433
434
bottom of the screen when `term.term_mode` is enabled.
434
435
"""
435
- return readline (- 1 , prompt , float )
436
+ return readline (- 1 , prompt , float ). rstrip ( os . linesep . encode ())
436
437
437
438
def str_input (prompt = '' , float = True ):
438
439
r"""str_input(prompt='', float=True)
@@ -445,7 +446,7 @@ def str_input(prompt='', float=True):
445
446
float(bool): If set to `True`, prompt and input will float to the
446
447
bottom of the screen when `term.term_mode` is enabled.
447
448
"""
448
- return readline (- 1 , prompt , float ).decode ()
449
+ return readline (- 1 , prompt , float ).decode (). rstrip ( os . linesep )
449
450
450
451
def eval_input (prompt = '' , float = True ):
451
452
"""eval_input(prompt='', float=True)
@@ -471,7 +472,7 @@ def eval_input(prompt='', float=True):
471
472
Favorite object? 20
472
473
"""
473
474
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 ()) )
475
476
476
477
def init ():
477
478
global safeeval
0 commit comments