Questions tagged [termcap]

termcap is a library and database that enables programs to use display terminals in a terminal-independent manner. It originated in Berkeley Unix.

termcap is an obsolete facility which has been superseded by the terminfo database and associated libraries.

72 questions
1
vote
1 answer

Termcap "cl" command doesn't clear screen

I can't seem to get termcap's "cl" command to work, but the terminal escape code does. For example: #include #include int main() { tputs(tgetstr("cl", NULL), 1, putchar); } This doesn't change the terminal. But when I…
1ShotSniper
  • 63
  • 1
  • 7
1
vote
1 answer

How to check if a highlight attribute is displayable on a terminal?

I am writing a plugin and need to check if a highlight attribute (bold, italic, underline and so on) is actually displayable on a terminal. I tried to check it with termcap. For example of the underline, !empty(&t_us) && !empty(&t_ue) becomes TRUE…
Rick Howe
  • 429
  • 3
  • 6
1
vote
2 answers

How to set a interface in terminal using termcap library

I need to create a interface in terminal using the termios.h in C. To keep it short I have to create a executable like ./exec and after I run, it has to stop displaying the PS1 variable. If I have a program which displays the following text Hello…
JohnnyOnPc
  • 386
  • 1
  • 5
  • 18
1
vote
1 answer

If else expression in terminfo parameterized strings

I am implementing a parser in C++ for parameterized strings(which are used for specifying some terminal capabilities for a terminal). Then I came across this on the man page of terminfo: %? expr %t thenpart %e elsepart %; This forms an…
tkhurana96
  • 919
  • 7
  • 25
1
vote
1 answer

TUI Text Editing

Working on C code that reads a line of text and allows cursor movement and editing using TERMCAP routines (similar to the "readline" library). Question is this: when one or more characters need to be erased from the end of the line, it is more…
italia389
  • 11
  • 2
1
vote
2 answers

Termcaps : Get cursor position

I need to get my (Y, X) position of my terminal's cursor with the termcaps in C. With ioctl() i get the size of my terminal screen, but i still need to get where my cursor is. I found this : CSI 6 n DSR – Device Status Report Reports the cursor…
albttx
  • 3,444
  • 4
  • 23
  • 42
1
vote
1 answer

Why the linux manpages program does not erase terminal

How does the man program manage to restore previous terminal output after taking over the entire screen? Does it involve ANSI escape sequences in a way?
TechDragon
  • 149
  • 1
  • 7
1
vote
2 answers

Termcap with parameters

I am coding a shell-like in C and I want to implement the line edition functionality, I already implemented the basic of it, now I want to implement ctrl+l which clear the screen then display the prompt and the line I was working on. I need to use…
Swann
  • 2,413
  • 2
  • 20
  • 28
1
vote
1 answer

ncurses support for italics?

Some terminals, such as urxvt, support display text in italics via the sitm and ritm terminfo entries: echo `tput sitm`italics`tput ritm` I'd like to use this in an application I've got which wants to render real italics into the console.…
David Given
  • 13,277
  • 9
  • 76
  • 123
0
votes
1 answer

Where does the linker find "-ltermcap" (libtermcap) on macOS (Monterey)?

I'd like to know where -ltermcap is being "found" on macOS (Monterey) (aka "libtermcap."). I know it's there, somewhere, because this fails to link: cc ../stepit/stepit.o ../readline/libreadline.a testit.o -o testit Undefined symbols for…
Stan Sieler
  • 729
  • 7
  • 16
0
votes
0 answers

Undefined symbols for architecture x86_64 termcap.h in C

I have this code: #include #include #include int main() { char *termtype = getenv("TERM"); int li = tgetnum("li"); printf("%d", li); return 0; } I can't compile it because I get Undefined…
MHDtA
  • 21
  • 1
0
votes
1 answer

Outputed lines doesn't wrap correctlly within a terminal in Non Canonical mode

I am trying to implement a mini version of bash using Termcap capabilities, and now I am trying to read user's input and retype it in the terminal Stdout. Every thing is working fine, but the problem occurs when trying to resize the terminal window,…
Holy semicolon
  • 868
  • 1
  • 11
  • 27
0
votes
1 answer

How to write to input part in C?

I'm trying to write a mini shell in C for a school project, and what I want to do is doing a sort of command history (like in shell), when I press the UP key it writes the previous input into the input part, DOWN does the opposite, etc..., and you…
Fayeure
  • 1,181
  • 9
  • 21
0
votes
1 answer

Why don't termcaps work before a `write` syscall?

Why is the output of this program not getting underlined int main() { tgetent(NULL, getenv("TERM")); tputs(tgetstr("us", NULL), 1, &putchar); write(1, "Hello world!\n", 13); tputs(tgetstr("ue", NULL), 1, &putchar); } but this is? int main()…
GingerBadger
  • 312
  • 3
  • 12
0
votes
0 answers

tcgetattr and tcsetattr in job contol seems to break termcaps

tcgetattr and tcsetattr in job contol Hello everyone. I'm currently recreating a shell in C, which include jobcontrol. I'm now recoding the fg built-in. According to this and this documentation, it seems they save the termios in the job structure…
Lubenard
  • 92
  • 2
  • 11