Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
0 votes
1 answer
372 views

How does `tput` detect color support

I am trying to make my shell script supporting as much terminals as possible, that is, adding ANSI colors, bold and dim only when supported. However, I want to detect the number of colors supported. ...
sudoer's user avatar
  • 55
1 vote
1 answer
406 views

terminfo/termcap `tput bold`/`tput md`: portability of bold text

Suppose I have the following color support in one of my portable shell scripts: #!/bin/sh set -o nounset tput_init_linux () { set_fg_color='tput setaf'; reset_color=$(tput sgr0 2>/dev/null); } ...
Vlastimil Burián's user avatar
1 vote
2 answers
357 views

Get terminal status for termcap capabilities

How can one retrieve status of terminal settings like smam and rmam ? Reason is that I set rmam by: tput rmam in script, then proceed to set smam on exit: tput smam But if terminal has rmam set when ...
ibuprofen's user avatar
  • 2,990
5 votes
2 answers
683 views

tput ed is empty

The output of tput ed is empty and I can't figure out why. Other capabilities work fine. Also ed is not missing from infocmp output so tput should match, right? $ printf '%q' "$(tput ed)" '' $ ...
cambunctious's user avatar
3 votes
1 answer
30k views

How to set the background color of the Linux console screen?

Note: I reworked the question to clarify the issues. This is a trivial question that can be answered in several parts because the question has several attributes. Unfortunately, the question may be ...
user avatar