summaryrefslogtreecommitdiff
path: root/rl_utils.py
diff options
context:
space:
mode:
authorEric Lin <anselor@gmail.com>2018-04-17 23:50:57 -0400
committerEric Lin <anselor@gmail.com>2018-04-17 23:50:57 -0400
commit93cc2461282067a3601d6ac546a99a40a60eef93 (patch)
tree8de40c68d199c4c268126e1b5eb3f3ab480b29d3 /rl_utils.py
parent658562235b9f4fd7b5ebb01b386cba9dc541e4e7 (diff)
downloadcmd2-git-93cc2461282067a3601d6ac546a99a40a60eef93.tar.gz
Added check for whether the terminal is present before reprinting the prompt. Re-enabled test cases that were failing due to there not being a terminal during unit tests.
Diffstat (limited to 'rl_utils.py')
-rw-r--r--rl_utils.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/rl_utils.py b/rl_utils.py
index 11c45ee4..1dc83d15 100644
--- a/rl_utils.py
+++ b/rl_utils.py
@@ -47,6 +47,8 @@ def rl_force_redisplay() -> None:
"""
Causes readline to redraw prompt and input line
"""
+ if not sys.stdout.isatty():
+ return
if rl_type == RlType.GNU:
# rl_forced_update_display() is the proper way to redraw the prompt and line, but we
# have to use ctypes to do it since Python's readline API does not wrap the function