Skip to content

Commit 0ccf020

Browse files
committed
echo working :-)
1 parent 6a6a257 commit 0ccf020

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

examples/nonblocking_serialinput_simpletest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def main():
3333
time.sleep(1)
3434
# we have to use the *drop-in* my_input.print() function.
3535
# otherwise the rmote echo handling does not work.
36-
my_input.print("")
36+
my_input.print(42 * "*")
3737
my_input.print("nonblocking_serialinput_simpletest.py")
3838
my_input.print(42 * "*")
3939

nonblocking_serialinput.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,6 @@ def __init__(
132132

133133
##########################################
134134
# output handling
135-
136135
# statusline
137136
# echo
138137

@@ -197,6 +196,7 @@ def echo_print(self):
197196
# move += terminal.ANSIControl.cursor.previous_line(line_count)
198197
# move += terminal.ANSIControl.cursor.previous_line(0)
199198
move += terminal.ANSIControl.erase_line(2)
199+
move += terminal.ANSIControl.cursor.horizontal_absolute(1)
200200

201201
# reprint line
202202
line = self._get_echo_line()
@@ -219,7 +219,6 @@ def echo_print(self):
219219
moveback=moveback,
220220
)
221221
)
222-
print("\n\n\n{}\n\n\n".format(repr(text)))
223222
# execute all the things ;-)
224223
print(text, end="")
225224

@@ -239,19 +238,19 @@ def print(self, *args):
239238
# :param bool end: line end character to print. Default: "\n"
240239
if self.echo or self.statusline:
241240
move = ""
242-
if self.statusline:
243-
# earease statusline
244-
move += terminal.ANSIControl.cursor.previous_line(1)
245-
move += terminal.ANSIControl.erase_line(2)
241+
# if self.statusline:
242+
# # earease statusline
243+
# move += terminal.ANSIControl.cursor.previous_line(1)
244+
# move += terminal.ANSIControl.erase_line(2)
246245
if self.echo:
247246
# earease echoline
248247
# move += terminal.ANSIControl.cursor.previous_line(1)
249248
move += terminal.ANSIControl.erase_line(2)
249+
move += terminal.ANSIControl.cursor.horizontal_absolute(1)
250250
# print("\n\n\n{}\n\n\n".format(repr(move)))
251251
# print(repr(terminal.ANSIControl.cursor.previous_line(1)))
252252
# print(repr(terminal.ANSIControl.erase_line(2)))
253253
print(move, end="")
254-
time.sleep(1)
255254
# *normally print output
256255
print(*args)
257256
# print(*args, end=end)
@@ -260,8 +259,8 @@ def print(self, *args):
260259
if self.echo:
261260
print(self._get_echo_line(), end="")
262261
# print(self._get_echo_line())
263-
if self.statusline:
264-
print(self._get_statusline(), end="")
262+
# if self.statusline:
263+
# print(self._get_statusline(), end="")
265264
# if not self.echo and not self.statusline:
266265
# # add new end
267266
# print()

0 commit comments

Comments
 (0)