Re: some problems with do_*_ca_mode()



Hello, Jindrich!
You wrote to "Leonard den Ottolander" <leonard den ottolander nl> on Wed, 23 
Nov 2005 20:23:37 +0100:

 JN> I agree with Andrey here, that we should use "ti" and "te" sequences
 JN> acquired from termcap database instead of hardcoded ones. The problem
 JN> is that Andrey uses direct putp() calls. The putp() belongs to ncurses
 JN> and it doesn't seem to work when slang support is enabled.
 JN> I propose this way to write termcap sequences to the terminal what
 JN> should work even with slang:

 JN> #ifdef HAVE_SLANG
 JN>   SLtt_write_string (ti_cap);
 JN> #else
 JN>   putp (ti_cap);
 JN> #endif
 JN> and similarly for the te_cap.

I argee, of course. Modified patch is attached.

 JN> The question is whether not to call SLtt_initialize () and friends in
 JN> case of slang instead as slang takes care of setting proper ti/te
 JN> sequences itself.

Hmm. For now we combine this approaches: we call SLtt_initialize (), we  let 
slang to take care of init itselt and prepare the SLtt_tgetstr() to work. 
And then we use it to obtain ti/te sequences using proper slang mechanisms.

And the same in ncurses case, BTW.

The main points are:

from main():

#ifdef HAVE_SLANG
(1)    slang_init () -> [ SLtt_get_terminfo() -> SLtt_initialize() -> 
Term_Init_Str = SLtt_tgetstr ("ti") ]
#else
(2)    init_curses () -> [ initscr() -> setupterm() ]
#endif
        init_xterm_support ();

Using [] brackets I've marked slang internal code at (1) and ncurses 
internal code at (2).
The "Term_Init_Str" is internal slang variable, and it is unavailable for us 
in common case. This is correct for current mcslang and libslang-1.4.9 both.

So, what prevents us from calling the same SLtt_tgetstr ("ti") routine from 
init_xterm_support() under "#ifdef HAVE_SLANG"?

-- 
With best regards, Andrey V. Malyshev.
E-mail: amal krasn ru 

Attachment: patch-xterm-ca-mode.gz
Description: Binary data



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]