diff options
author | Alejandro Colomar <alx@kernel.org> | 2023-10-10 04:20:07 +0200 |
---|---|---|
committer | Alejandro Colomar <alx@kernel.org> | 2023-10-10 04:58:14 +0200 |
commit | 53973e375f0d93bd5946b9d7c840c2ef711ada65 (patch) | |
tree | dbd22b7a5da3e75a00e32e374c8a1b86f4e97670 | |
parent | 920957bb0e30198f49de649b111b4a4e04f24c4d (diff) |
bin/ovr: --no-alt: Don't overwrite stderr
Move part of the escape sequence to the end of stdout lines, instead of
the begining of lines, so that a stdout line won't overwrite the
previous line if it comes from stderr. Instead, a stderr line coming
after a stdout one will overwrite it.
Signed-off-by: Alejandro Colomar <alx@kernel.org>
-rwxr-xr-x | bin/ovr | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -29,8 +29,8 @@ ovr_alt() ovr_noalt() { setterm --linewrap off; - sed \ - -e '2,$ s/^/\x1B[1A\x1B[K/'; + sed -e '$ ! s/$/\x1B[1A/' \ + -e '2,$ s/^/\x1B[K/'; setterm --linewrap on; } |