[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 1/5] python: qmp_shell: don't prompt when stdin is non-interactiv
From: |
Damien Hedde |
Subject: |
[PATCH 1/5] python: qmp_shell: don't prompt when stdin is non-interactive |
Date: |
Mon, 21 Feb 2022 16:55:15 +0100 |
In that case, there is no echo anyway. So the prompt is just
garbage.
Signed-off-by: Damien Hedde <damien.hedde@greensocs.com>
---
python/qemu/aqmp/qmp_shell.py | 2 ++
1 file changed, 2 insertions(+)
diff --git a/python/qemu/aqmp/qmp_shell.py b/python/qemu/aqmp/qmp_shell.py
index d11bf54b00..a6e0f5af42 100644
--- a/python/qemu/aqmp/qmp_shell.py
+++ b/python/qemu/aqmp/qmp_shell.py
@@ -367,6 +367,8 @@ def prompt(self) -> str:
"""
Return the current shell prompt, including a trailing space.
"""
+ if not sys.stdin.isatty():
+ return ""
if self._transmode:
return 'TRANS> '
return '(QEMU) '
--
2.35.1
- [PATCH 0/5] qmp-shell modifications for non-interactive use, Damien Hedde, 2022/02/21
- [PATCH 1/5] python: qmp_shell: don't prompt when stdin is non-interactive,
Damien Hedde <=
- [PATCH 3/5] python: qmp_shell: refactor disconnection handling, Damien Hedde, 2022/02/21
- [PATCH 2/5] python: qmp_shell: refactor the parsing error handling, Damien Hedde, 2022/02/21
- [PATCH 5/5] python: qmp_shell: handle comment lines and escaped eol, Damien Hedde, 2022/02/21
- [PATCH 4/5] python: qmp_shell: add -e/--exit-on-error option, Damien Hedde, 2022/02/21
- Re: [PATCH 4/5] python: qmp_shell: add -e/--exit-on-error option, John Snow, 2022/02/23
- Re: [PATCH 4/5] python: qmp_shell: add -e/--exit-on-error option, Daniel P . Berrangé, 2022/02/23
- Re: [PATCH 4/5] python: qmp_shell: add -e/--exit-on-error option, John Snow, 2022/02/23
- Re: [PATCH 4/5] python: qmp_shell: add -e/--exit-on-error option, Daniel P . Berrangé, 2022/02/23
- Re: [PATCH 4/5] python: qmp_shell: add -e/--exit-on-error option, John Snow, 2022/02/23
- Re: [PATCH 4/5] python: qmp_shell: add -e/--exit-on-error option, Damien Hedde, 2022/02/23