Commit 1183e268 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
parents 175aca9f 85f3d5f8
Pipeline #75622 failed with stages
in 105 minutes and 19 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,
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:
return res
patch_stdout_module.StdoutProxy = BlissStdoutProxy
if is_windows():
class Terminal:
......@@ -69,6 +84,7 @@ if is_windows():
raise AttributeError(prop)
return ""
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