[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-bash] read -ep and ANSI colour sequences

From: Chris F.A. Johnson
Subject: Re: [Help-bash] read -ep and ANSI colour sequences
Date: Wed, 20 Feb 2013 19:47:50 -0500 (EST)
User-agent: Alpine 2.00 (LMD 1167 2008-08-23)

On Thu, 21 Feb 2013, Matthew Cengia wrote:

On 2013-02-20 13:00, Chris F.A. Johnson wrote:
On Wed, 20 Feb 2013, Greg Wooledge wrote:
And whatever you do, STOP hard-coding terminal-specific escape sequences.
This will cease working when you run it on a terminal that uses different
escape sequences.

   I agree in principle, but for all practical purposes, there is one
   standard terminal nowadays, ISO 6429.

This is why we have termcap/terminfo libraries and a $TERM variable.

   Which cannot be used reliably in the shell.

I'm happy to be corrected, but isn't this exactly what 'tput' is for?

   Ideally. However, there are two versions of tput; one uses termcap
   and the other uses terminfo. The commands are not the same for
   both, so portability is a problem.

   The POSIX specification only requires tput to have three operands:
   clear, init, and reset.

   The ISO 6429 sequences are at least as portable as tput, and
   probably more so.

   Chris F.A. Johnson, <>
   Pro Bash Programming: Scripting the GNU/Linux Shell (2009, Apress)
   Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]