For Programmers: Free Programming Magazines  


Home > Archive > Unix Programming > October 2007 > Re: Terminal output with escape sequences: Any way to get the flags at a given positi









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: Terminal output with escape sequences: Any way to get the flags at a given positi
Stephane CHAZELAS

2007-10-23, 7:18 pm

2007-10-23, 16:23(+02), Markus Mayer:
[...]
> I use sequences like \033[4m (underscore) to pimp up my program's
> output. However I am wondering if there is any method to actually to
> actually GET the flags set for a given character on the terminal. In
> other words: If I know the character's position (i.e. the location the
> cursor is), how do I determine whether the character is underscored or not?

[...]

In short you can't.

IF you want to do that, you'll need to do as the ncurses or
slang libraries do, that is maintain an internal representation
of the content of the screen.

There's no standard terminal API to retrieve what's at a
specific position on the screen, though some terminals may
provide with one.

GNU screen stores the content of the screen internally, so you
might be able to query it, and if not, to patch it to add that
functionality if you're really desperate.

--
Stéphane
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com