Questions tagged [terminfo]

Terminfo is a database of terminal capabilities use by applications that require information about the terminal's features.

Terminfo is a data base describing terminals, used by screen-oriented programs such as nvi(1) and rogue(1).

Terminfo describes terminals by giving a set of capabilities which they have, by specifying how to perform screen operations, and by specifying padding requirements and initialization sequences.

127 questions
1
vote
2 answers

Can I push/pop attributes with tput?

In the answer to this question, it uses the following (simplified): echo "this is $(tput bold)bold$(tput sgr0) but this isn't" But that tput sgr0 resets all of the text attributes. I'd like to output coloured text, with only some of it in bold. So…
Roger Lipscombe
  • 89,048
  • 55
  • 235
  • 380
1
vote
1 answer

why does ''tput ed'' delete lines, instead of just clearing one line?

i want to rewrite first line but tput is removing all lines instead of first line im testing this cl=$(tput ed) tput sc echo 'line1____' echo 'line2____' echo 'line3____' sleep 1 tput rc echo "abc$cl" echo '' echo '' sleep 1 when done it should…
stuffy
  • 48
  • 1
  • 5
1
vote
0 answers

Removing dependency on Terminfo package from a GHC compiled binary

I'd like to remove terminfo package from the default dependencies of my GHC installation, as the generated executable does not run in a particular environment without libtinfo, saying: ./Main: error while loading shared libraries: libtinfo.so.6:…
Keigo Imai
  • 155
  • 1
  • 1
  • 9
1
vote
2 answers

How to get current keyboard cursor position in Linux terminal

I am dealing with an issue in Ubuntu. I want to get current keyboard cursor position in terminal via Gcc any assist...
synapsis
  • 15
  • 2
1
vote
0 answers

How to reset $(tput bold) only?

I’m making some post-formatting of a log for better readability. Using regular expressions, my script recognizes some patterns in the stream and makes the correspondent text bold by inserting the $(tput bold) and $(tput sgr0) values at the beginning…
oneastok
  • 323
  • 1
  • 11
1
vote
1 answer

Reset only the foreground color using terminfo

By using the ANSI sequence Esc[39m in a terminal, it is possible to clear the foreground color without altering other attributes like bold, underline, or the background color. For example: echo -e "\e[31;1mRed and bold.\e[39m Bold only." I would…
yolenoyer
  • 8,797
  • 2
  • 27
  • 61
1
vote
1 answer

xterm reports wrong escape sequences on raw input

I am currently trying to do raw input in Linux (e. g. the stuff I'd normally use ncurses or similar). I already got so far as that every single keypress is directly reported to my application and is dumped as a sequence of hex codes. If I press the…
writzlpfrimpft
  • 333
  • 3
  • 14
1
vote
1 answer

Terminal-agnostic color printing in C without using ncurses

I'm writing a C program that outputs test results, and I'd like it to print them in color so it's easier to scan through the results. I initially just used ANSI color codes (per https://stackoverflow.com/a/23657072/4954731), but a code reviewer…
sheesania
  • 237
  • 3
  • 8
1
vote
1 answer

How can I send clear or reset with Term::Cap?

When I output tput clear | hexdump -c I get different results if I'm on kitty or xterm. How can I use Term::Cap to generate these terminal signals on the respective terminal? What I've tried is a direct-copy-paste from the docs with setup, use…
Evan Carroll
  • 78,363
  • 46
  • 261
  • 468
1
vote
2 answers

how to enable mouse movement events in curses

How do I enable mouse movement events in curses? I found this Mouse movement events in NCurses, Xterm Control Sequences and ncurses_mouse_movement but I don't understand from that, how to enable mouse movement events in python-curses. I figure it…
Rolf
  • 84
  • 6
1
vote
1 answer

ncurses test programs failing with message "Error opening terminal: xterm"

(Note: this is similar to this question, but the answer there does not apply.) Running under FreeBSD, I have ncurses installed via the usual pkg method for FreeBSD, but because I've seen some odd behaviour with a previously working curses program, I…
varro
  • 2,382
  • 2
  • 16
  • 24
1
vote
1 answer

How does ncurses search for terminal descriptions

I'm building ncurses 6.1 from source for some reasons. First I configure the sources with ./configure and then I build it with make both without arguments. When I try to run tests I get the error message Error opening terminal: xterm-256color. on…
Thomas Sablik
  • 16,127
  • 7
  • 34
  • 62
1
vote
2 answers

What's the difference between cursor_up (cuu1) and key_up (kcuu1) in terminfo(5)?

In terminfo(5): Variable String Capname TCap Code Description cursor_up cuu1 up up one line key_up kcuu1 ku up-arrow key I tried with tput and they produce the same output: $ tput cuu1 | hd -C 00000000 1b 5b 41 …
pynexj
  • 19,215
  • 5
  • 38
  • 56
1
vote
1 answer

Recognizing special keys without taking over the screen

In a program that uses the curses or ncurses library, the getch() function can recognize either an ordinary character (like 'x') or the escape sequence sent by the arrow and function keys. For example, typing the up arrow key might send the sequence…
Keith Thompson
  • 254,901
  • 44
  • 429
  • 631
1
vote
1 answer

terminfo parameterized string %d encoding behavior

I'm trying to understand the behavior of %d encoding in terminfo's parameterized string parser. The relevant man page is here and states that - %[[:]flags][width[.precision]][doxXs] as in printf, flags are [-+#] and space. Use a ":" to…
Abhinav Gauniyal
  • 7,034
  • 7
  • 50
  • 93
1 2 3
8 9