0

I'm trying to make a simple autocompletion tool for my program, and i would it look like as this picture : https://github-camo.global.ssl.fastly.net/ac6492f955c9d8027b6f691e1e3df6052fa16599/687474703a2f2f6e6f736d696c65666163652e72752f696d616765732f63636f6465322e706e67

There are termcaps who can help me to make this ? As a little "te" "ti" capabilities ?

Thank you.

Druxtan
  • 1,311
  • 2
  • 15
  • 21
  • what have you tried and how much have you been successfull/what was the result? – V-X Feb 11 '14 at 11:04
  • I tried with "fd = open("/dev/tty", O_RDWR);", where i wrote on fd, and then i erased the line, but it clear all the line, even if it's not on the second tty. I tried with termcap te and ti, but he's make it all my screen on second buffer. – Druxtan Feb 11 '14 at 11:55
  • Or it's possible to get the xterm buffer ? – Druxtan Feb 11 '14 at 17:55

1 Answers1

0

Generally, you cannot get the screen contents, because some people view the notion of an escape sequence which can return the screen contents as a security problem.

The xterm ti/te termcap capabilities do not return the information on the screen. Instead, they tell xterm to switch between the normal and alternate screen buffers. But those cover the entire screen -- not a portion of it as your example suggests. Also, these sequences are sent by any conventional application at the beginning and end of "full-screen" mode -- so your application is likely already using the alternate screen.

Instead, your application has to keep track of what it puts on the screen, so that it can repaint after the popup window goes away. That is something that ncurses, for example, is designed to do.

Thomas Dickey
  • 51,086
  • 7
  • 70
  • 105