Skip to main content

Questions tagged [tput]

The tag has no summary, but it has a tag wiki.

0 votes
1 answer
61 views

I am doing a code-study of /lib/lsb/init-functions on mint 20 just to familiarise myself with SystemV init system. There is log_action_end_msg function in it which has this code snippet, TPUT=/usr/bin/...
Saravana's user avatar
  • 193
2 votes
1 answer
375 views

I'm using bash in cygwin on a Windows laptop. I'd like to be able to change the background color of my terminal to green (actual color irrelevant) and to do that I can use either of these commands: ...
Ed Morton's user avatar
  • 36k
2 votes
1 answer
178 views

I captured the output of a script that uses tput to draw certain things on screen. When I perform cat myoutput then everything is well seen (looks like terminal reinterprets it from beginning), but ...
Whimusical's user avatar
-1 votes
1 answer
358 views

When I do tput sgr0 it changes my terminal font and colour to white (should be black) and looks blocky. Please see screenshot: How do I stop this? To be more concise, any echo after tput sgr 0 seems ...
Nickotine's user avatar
  • 554
1 vote
2 answers
2k views

ive written the following script to print out the current line and row every time it changes aka every time i press up,down,left or right but the output is always the same: row:43:col:141 i believe ...
Mathew's user avatar
  • 243
1 vote
2 answers
212 views

In OBSD ksh, I had a PS1 which prepended a blank line: PS1="\n[\u@\h] \w\n\$" The problem with this was that pyenv prepends the name of a virtual environment when that environment is ...
user1093043's user avatar
0 votes
2 answers
206 views

I want to change the text colour in a shell. I can use tput to get the correct escape codes. For example, echo "$(tput setaf 5)My text$(tput sgr0)" outputs My text in a pink-ish tone. This ...
FWDekker's user avatar
  • 101
0 votes
1 answer
531 views

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
  • 65
1 vote
0 answers
209 views

When I exit a screen, I want to be able to return to the terminal looking as I left it. But right now, all I can do is have it clear the screen and put the terminal at the top or the bottom through ...
Jeff's user avatar
  • 121
4 votes
1 answer
6k views

How to check if a terminal can display undercurl from within a bash/zsh script? In a recent project I used undercurl escape sequence for output printed by a zsh script. It works well in modern ...
codepoet's user avatar
  • 636
1 vote
1 answer
469 views

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
0 votes
1 answer
70 views

I have a script that uses tput and runs in a initrd. Specifically I'm using tput -T linux [sc|rc|ed] > /dev/tty0 to overwrite multiple lines. When I run in a qemu vm, it works perfectly. When I run ...
Gary van der Merwe's user avatar
2 votes
1 answer
561 views

This is my ~/.bashrc: # ...unnecessary lines skipped... # man colors LESS_TERMCAP_mb=$(tput blink) # start bold LESS_TERMCAP_md=$(tput setaf 2 ; tput bold) # start bold LESS_TERMCAP_me=$(tput sgr0) # ...
Alexander's user avatar
0 votes
1 answer
217 views

Given the following contrived example which intent is to only erase the subcommand's /dev/tty: result="$( tput smcup > /dev/tty tput cup 0 0 > /dev/tty echo 'meh' > /dev/tty echo ...
balupton's user avatar
  • 644
0 votes
1 answer
193 views

Given the following contrived example (proper example would be guiding the user through a series of questions and echoing to stdout the computed results from the user's answers), how can I have it so ...
balupton's user avatar
  • 644

15 30 50 per page