On 13 August 2013 01:21, Thomas Dickey <[email protected]> wrote:
> On Mon, Aug 12, 2013 at 01:09:46PM +1000, Danny Weldon wrote:
>> On 11 August 2013 16:52, Dan Shelton <[email protected]> wrote:
>>
>> > On 11 August 2013 07:55, Dan Shelton <[email protected]> wrote:
>> > > On 11 August 2013 07:50, Dan Shelton <[email protected]> wrote:
>> > >> Does anyone know a portable way (portable across most terminals that
>> > >> is, or maybe something which can be done with tput) to read the
>> > >> terminal cursor x position without using curses or ncurses?
>> > >>
>> > >> I'm asking because ksh93 has notorious problems with getting the
>> > >> cursor position correct if PS1-PS4 contain unusual escape sequences or
>> > >> characters which take more than one terminal cell (xterm256 color
>> > >> sequences or the unicode '...' character) which makes the set -o
>> > >> multiline mode unusable.
>> > >
>> > > Send too early. Yes, I've read
>> > > http://www.tldp.org/HOWTO/Bash-Prompt-HOWTO/x405.html, but it doesn't
>> > > help:
>> > > tput cup returns "i%p1%d;%p2%dH" and I have no clue how to grok that,
>> > > plus I only want to alter the X position and not Y too.
>> >
>> > tput cub1 and tput cuf1 move the cursor backwards and forwards. cub
>> > and cuf commands don't work for us because some terminals don't grok
>> > it (TERM=sun for example).
>> >
>> > Thomas, any ideas?
>> >
>> > Dan
>> > _______________________________________________
>> > ast-users mailing list
>> > [email protected]
>> > http://lists.research.att.com/mailman/listinfo/ast-users
>> >
>>
>> I don't think it's possible to ask the terminal itself.  I think
>> curses/ncurses libraries keep track of the cursor position themselves, as
>> does the shell.
>
> agree (some terminals - not "sun" - support a cursor-position report which 
> can be used,
> but that would require modifying ksh93 to use it - when available)

What is so special with the "sun" and "sun-color" terminal type that a
lot of the tput commands don't work? Why does bash work on this kind
of terminal?

Dan
_______________________________________________
ast-users mailing list
[email protected]
http://lists.research.att.com/mailman/listinfo/ast-users

Reply via email to