diff options
author | Alejandro Colomar <alx@kernel.org> | 2023-10-10 04:57:26 +0200 |
---|---|---|
committer | Alejandro Colomar <alx@kernel.org> | 2023-10-10 04:57:26 +0200 |
commit | 920957bb0e30198f49de649b111b4a4e04f24c4d (patch) | |
tree | c828b4290de54a3837fbe15cbe1bae498166eab8 | |
parent | 15370a64924b1efc189ae5b77cb0cc811e173ef4 (diff) |
bin/ovr: --no-alt: Use setterm --linewrap off to trim long lines
This is more reliable, and probably faster, than using sed(1).
Signed-off-by: Alejandro Colomar <alx@kernel.org>
-rwxr-xr-x | bin/ovr | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -28,8 +28,10 @@ ovr_alt() ovr_noalt() { - sed -e "s/^\(.\{,$(tput cols)\}\).*$/\1/" \ - -e '2,$s/^/\x1B[1A\x1B[K/'; + setterm --linewrap off; + sed \ + -e '2,$ s/^/\x1B[1A\x1B[K/'; + setterm --linewrap on; } |