Questions tagged [tput]

Utility to make the values of terminal-dependent capabilities and information available to the shell. Often used to set shell color.

72 questions
42
votes
6 answers

Docker number of lines in terminal changing inside docker

I would like to know how to change the following behavior. Let's say my terminal has 28 lines. Then I use the following commands: $ tput lines # my terminal 28 $ docker run --rm -it ubuntu:16.04 tput lines # docker container 24 ## WHY?? $ docker…
silgon
  • 6,890
  • 7
  • 46
  • 67
32
votes
3 answers

"tput: No value for $TERM and no -T specified " error logged by CRON process

We have a shell script which is run by CRON. The shell script in turn runs a python script which downloads files from an FTP server and then runs a java log processor on those files. The process runs just fine, except that I keep on getting CRON…
Seagull
  • 2,219
  • 6
  • 25
  • 33
12
votes
2 answers

tput: unknown terminal

I'm on AIX-6.1 and I'm trying to make use of tput inside my $PS1. I've confirmed I can't even run tput from the commandline. Following is my session: # tput unknown terminal "xterm" # echo $TERM xterm # tput -T ansi unknown terminal "ansi" In…
wasosa
7
votes
2 answers

Bash - Clearing the last output correctly

I'm trying to create an update-able progress status. In order to do that, I need to be able to clear the last output in its entirety so that I can update it. Carriage returns can work, but when the output is longer than the terminal width and wraps…
what the
  • 398
  • 3
  • 10
4
votes
1 answer

How to get the screen state as set by tput smcup/rmcup?

Whilst I know that tput rmcup returns from the "alternate screen" (referred to as "cup mode" in man 5 terminfo) and restores the saved screen, it does have the side-effect of repositioning the cursor. So if tput smcup was called, tput rmcup restores…
IpsRich
  • 797
  • 10
  • 23
3
votes
1 answer

How to display text at the bottom of the terminal window, and make it stay there, in Bash?

I am using a while loop to perform an ffmpeg operation that makes a bunch of files, and I want an indicator at the bottom of the screen that says what file I am on, that stays at the bottom of the screen, while ffmpeg is giving output. Sort of…
nswerhun
  • 144
  • 8
3
votes
1 answer

How to format columns with printf in bash when tput is used

Using tput changes the length of the string and so columns are not aligned. How to fix this? Tried following code in bash script. B="$(tput bold)" # Bold text N="$(tput sgr0)" # Normal text function testing(){ IN="KEYS | VALUES | DESCRIPTION id |…
R. Adams
  • 55
  • 6
3
votes
1 answer

Color codes for tput setf

I am sourcing a file with this content export fgBlack8="$(tput setf 0)"; export fgRed8="$(tput setf 1)"; export fgGreen8="$(tput setf 2)"; export fgYellow8="$(tput setf 3)"; export fgBlue8="$(tput setf 4)"; export fgMagenta8="$(tput setf 5)"; export…
Benj
  • 889
  • 1
  • 14
  • 31
3
votes
1 answer

Line created with tput gets removed on scroll

I have the following BASH function that takes arguments and displays them at the bottom of the terminal in a new line that's excluded from the scroll region: bottomLine() { clear # Get all arguments and assign them to a var CONTENT=$@ …
Neekoy
  • 2,325
  • 5
  • 29
  • 48
3
votes
1 answer

Using tput with make

I am looking to do some formatting of the output from my makefile using tput. An example: if you simply type echo $(printf '%*s' "${COLUMNS:-$(tput cols)}" '' | tr ' ' –) as a command in your shell it will output a nice line spanning the entire…
Audun Olsen
  • 597
  • 6
  • 17
2
votes
1 answer

What changes the result of the 'tput lines' command?

I executed following code on bash on the terminal which have LINES=50. The result of 'tput lines' command varied. I have no idea to explain this results. Why the 'tput lines' command may returns '24' ? The code: #!/bin/sh echo $LINES tput lines tput…
for2ando
  • 23
  • 2
2
votes
4 answers

Error "tput No value for $TERM and no -T specified"

I have a shell script in server A and I have a shell script in server B. My logic is written like shell script in A gets executed and it calls a shell script in server B and executes it. I am able to get the desired result when A executes B, but…
Muthu
  • 39
  • 2
  • 5
2
votes
2 answers

In zsh, how can I re-color a text that has already been output?

When I already have a text typed out on the terminal, can I modify its properties? (I want to tput rev my command prompt upon preexec().)
user569825
  • 2,369
  • 1
  • 25
  • 45
2
votes
1 answer

Edeliver: tput: No value for $TERM and no -T specified

I'm trying to do automatic deployment in Jenkins machine with edeliver to our production. There seems to be something wrong with my build machine. mix edeliver build release --verbose --branch=70818f1f707545aaec17e0ca3daa035e7eea4746 tput: No…
2
votes
1 answer

backspace does not remove tput command's underline in bash

i'm trying to practice to do a nice and neat interface. However, i'm stuck at this problem. I'm trying to underline the input of the user which i managed to do it using this method echo -n "Title : "; read -p "$(tput smul)" getTitle; tput rmul…
Bryan
  • 8,488
  • 14
  • 52
  • 78
1
2 3 4 5