Commit 56b2d64c authored by Matias Guijarro's avatar Matias Guijarro
Browse files

Merge branch '3377-fix-carriage-return-in-bliss-prompt' into 'master'

Resolve "fix carriage return in bliss prompt"

Closes #3377

See merge request !4680

(cherry picked from commit 1183e268)

85f3d5f8 patch StdoutProxy
parent fd2134e0
Pipeline #75623 passed with stages
in 3 minutes and 21 seconds
......@@ -28,7 +28,11 @@ from collections import deque
from datetime import datetime
import ptpython.layout
from prompt_toolkit.patch_stdout import patch_stdout as patch_stdout_context
from prompt_toolkit.patch_stdout import (
patch_stdout as patch_stdout_context,
StdoutProxy,
)
from prompt_toolkit import patch_stdout as patch_stdout_module
from prompt_toolkit.output import DummyOutput
# imports needed to have control over _execute of ptpython
......@@ -61,6 +65,17 @@ from bliss.common.protocols import ErrorReportInterface
logger = logging.getLogger(__name__)
class BlissStdoutProxy(StdoutProxy):
def _write(self, data: str):
res = super()._write(data)
if "\r" in data:
self.flush()
return res
patch_stdout_module.StdoutProxy = BlissStdoutProxy
if is_windows():
class Terminal:
......@@ -69,6 +84,7 @@ if is_windows():
raise AttributeError(prop)
return ""
else:
from blessings import Terminal
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment