Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 496186 Details for
Bug 631870
sys-apps/gentoo-functions-0.12 should use tput for ENDCOL
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[PATCH] functions.sh: Don't hardcode escape seqences for ENDCOL.
0001-functions.sh-Don-t-hardcode-escape-seqences-for-ENDC.patch (text/plain), 1.07 KB, created by
Ulrich Müller
on 2017-09-23 18:40:07 UTC
(
hide
)
Description:
[PATCH] functions.sh: Don't hardcode escape seqences for ENDCOL.
Filename:
MIME Type:
Creator:
Ulrich Müller
Created:
2017-09-23 18:40:07 UTC
Size:
1.07 KB
patch
obsolete
>From 3c0e9e34707ad3452028844c1917293876d18a25 Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Ulrich=20M=C3=BCller?= <ulm@gentoo.org> >Date: Sat, 23 Sep 2017 20:38:29 +0200 >Subject: [PATCH] functions.sh: Don't hardcode escape seqences for ENDCOL. > >Similar to handling of colors, this should make use of tput, >rather than sending unknown escape sequences to dumb terminals. > >Bug: https://bugs.gentoo.org/631870 >--- > functions.sh | 8 +++++--- > 1 file changed, 5 insertions(+), 3 deletions(-) > >diff --git a/functions.sh b/functions.sh >index 3ea9daa..d241838 100644 >--- a/functions.sh >+++ b/functions.sh >@@ -444,10 +444,12 @@ COLS="${COLUMNS:-0}" # bash's internal COLUMNS variable > [ -z "$COLS" ] && COLS=80 > [ "$COLS" -gt 0 ] || COLS=80 # width of [ ok ] == 7 > >-if yesno "${RC_ENDCOL}"; then >- ENDCOL='\033[A\033['$(( COLS - 8 ))'C' >-else >+if ! yesno "${RC_ENDCOL}"; then > ENDCOL='' >+elif command -v tput >/dev/null 2>&1; then >+ ENDCOL="$(tput cuu1)$(tput cuf $(( COLS - 8 )) )" >+else >+ ENDCOL='\033[A\033['$(( COLS - 8 ))'C' > fi > > # Setup the colors so our messages all look pretty >-- >2.14.1 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 631870
:
496186
|
795604