Terminfo is a data base describing terminals, used by screen-oriented programs such as nvi(1), rogue(1) and libraries such as ncurses(3NCURSES). 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. - taken from the manpage.
Questions tagged [terminfo]
49 questions
16
votes
5 answers
The easiest way to clear scrollback buffer of terminal + some deeper explanation?
Why bother?
Clearing scrollback buffer is handy in many ways, for example, when I wish to run some command with long output, and want to quickly scroll to start of this output. When scrollback buffer is cleared, I can just scroll to top, and will be…
Anthony
- 567
- 1
- 5
- 14
12
votes
1 answer
Save cursor position and restore it in terminal
I am playing with some terminal capabilities to create async prompt output on bash. I want to get something like this: while outputting string in PROMPT_COMMAND, save terminal cursor position, print put ... and go do other stuff (printing other info…
Lapshin Dmitry
- 323
- 2
- 13
11
votes
1 answer
How can I pass function keys to htop in a tty?
I'm trying to use htop in tty1. However, some of the function keys don't appear to work as normal. F1 and F2 do nothing, and F3 seems to trigger setup (which should normally be triggered by F2). In addition, F4 and F5 don't work. Also, when I try…
Sparhawk
- 19,561
- 18
- 86
- 152
10
votes
2 answers
Terminal escape sequences: why don't terminals report what features they support, instead of relying on terminfo?
I've been looking into escape sequences lately, and I'm surprised of what they can do. You can even move an xterm X11 window with them (try printf '\e[3;0;0t'), wow!
The most common way to know what features a terminal supports seems to be using a…
peoro
- 3,658
- 3
- 32
- 32
10
votes
2 answers
Why END key does not have terminfo entry?
On a Debian system pressing END key generates ^[[F:
$ showkey -a
Press any keys - Ctrl-D will terminate this program
^[[F 27 0033 0x1b
91 0133 0x5b
70 0106 0x46
But why this keychord is not in terminfo?
$ infocmp -1 | grep…
Igor Liferenko
- 703
- 4
- 16
8
votes
2 answers
How can I use terminfo entries on FreeBSD?
On my local Linux machine, I'm using termite (VTE-based). It comes with its own terminfo file (xterm-termite), which is not distributed with ncurses by default.
I try to connect to a remote FreeBSD server. Unfortunately, FreeBSD by default only uses…
Wilhelm Schuster
- 115
- 2
- 6
6
votes
2 answers
Parse terminfo u6 string
Looking at terminfo and Parameterized Strings.
Some examples from infocmp -1 xterm:
cud=\E[%p1%dB, given argument 13:
\E =>
[ => [
%p1 PUSH parameter 1 (13) onto stack
%d POP and print from stack as signed decimal => 13
Result:…
ibuprofen
- 2,781
- 1
- 14
- 33
5
votes
2 answers
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)"
''
$ printf '%q' "$(tput home)"
$'\033'\[H
I'm using zsh on…
cambunctious
- 198
- 8
5
votes
2 answers
A set of libraries like ncurses in a shell script
Supose you present the following TUI in the shell:
I need a set of libraries that can be used in the shell to do it. Being sure, ncurses has not been used, because it make a dependecy.
Question: How to build the widget/window or another TUI in the…
PersianGulf
- 10,728
- 8
- 51
- 78
4
votes
1 answer
TERM=tmux-256color causes "Error opening terminal"
I want to enable italics in tmux (inside iTerm2 on macOS Big Sur 11.3). I have achieved this by setting this in .tmux.conf
set -g default-terminal "tmux-256color"
And I have installed ncurses 6.2 using homebrew and set it first in the path.…
Klas Mellbourn
- 387
- 4
- 13
4
votes
2 answers
What is the actual use of toe command in linux?
I am trying to understand the use of toe command.
From the man pages it's difficult for me to figure out what the command does.
Plus I cannot find any examples on the internet.
from the manpage:
toe - table of (terminfo) entries
[..] lists all…
Marinos An
- 779
- 7
- 11
4
votes
1 answer
Zsh get terminfo keys with modifiers
The Arch Linux Wiki page on Zsh has an example that gets key sequences from terminfo in it.
typeset -g -A key
key[Home]="${terminfo[khome]}"
key[End]="${terminfo[kend]}"
...
But how would I get ones with modifiers? Specifically Alt+j and…
aaa
- 207
- 1
- 11
4
votes
1 answer
Why do I not need to reset text attributes with less?
This script outputs 5 lines with the third one being underlined:
#!/usr/bin/env bash
set -eu
bold=$(tput bold)
reset=$(tput sgr0)
underline=$(tput smul)
echo 'line 1
line 2
line 3
line 4
line 5' | awk -v bold="$bold" -v reset="$reset" -v…
x-yuri
- 3,223
- 10
- 39
- 62
4
votes
3 answers
Why isn't screen on macOS picking up my ~/.terminfo?
I'd like to get Terminfo for my terminal (rxvt-unicode) working, so that when I ssh from Linux to macOS, the Home/End and other keys work properly.
Usually, to accomplish this with a Linux remote host, I use a script like the following:
ssh "$1"…
Vladimir Panteleev
- 1,596
- 15
- 29
4
votes
1 answer
Is there a way to provide "overrides" to a terminfo entry?
At least in Linux, on RedHat, the provided xterm terminfo entry is buggy: for whatever reason, they use an initialization sequence via is2 capability that forces an 80-column screen (See CSI ? n l). This is a very silly thing to do. So I want to…
Otheus
- 5,945
- 1
- 22
- 53