aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/python/prompt-toolkit/py3/prompt_toolkit/renderer.py
diff options
context:
space:
mode:
authorarcadia-devtools <arcadia-devtools@yandex-team.ru>2022-06-28 14:46:28 +0300
committerarcadia-devtools <arcadia-devtools@yandex-team.ru>2022-06-28 14:46:28 +0300
commit86568a9d1590ec529af95a7e16fb889b09162ed9 (patch)
treedbad39b76dcca72fd5551a0f782f6ad2a2bcd199 /contrib/python/prompt-toolkit/py3/prompt_toolkit/renderer.py
parente6eedf7496d3741c2226a52ac25b12851b331112 (diff)
downloadydb-86568a9d1590ec529af95a7e16fb889b09162ed9.tar.gz
intermediate changes
ref:8cc96053e249b790770c75de97ccbea86351cff2
Diffstat (limited to 'contrib/python/prompt-toolkit/py3/prompt_toolkit/renderer.py')
-rw-r--r--contrib/python/prompt-toolkit/py3/prompt_toolkit/renderer.py16
1 files changed, 10 insertions, 6 deletions
diff --git a/contrib/python/prompt-toolkit/py3/prompt_toolkit/renderer.py b/contrib/python/prompt-toolkit/py3/prompt_toolkit/renderer.py
index e40fc9e875f..463555c9ddd 100644
--- a/contrib/python/prompt-toolkit/py3/prompt_toolkit/renderer.py
+++ b/contrib/python/prompt-toolkit/py3/prompt_toolkit/renderer.py
@@ -799,12 +799,16 @@ def print_formatted_text(
output.reset_attributes()
last_attrs = attrs
- # Eliminate carriage returns
- text = text.replace("\r", "")
-
- # Assume that the output is raw, and insert a carriage return before
- # every newline. (Also important when the front-end is a telnet client.)
- output.write(text.replace("\n", "\r\n"))
+ # Print escape sequences as raw output
+ if "[ZeroWidthEscape]" in style_str:
+ output.write_raw(text)
+ else:
+ # Eliminate carriage returns
+ text = text.replace("\r", "")
+ # Insert a carriage return before every newline (important when the
+ # front-end is a telnet client).
+ text = text.replace("\n", "\r\n")
+ output.write(text)
# Reset again.
output.reset_attributes()