some problems with do_*_ca_mode()


I've found some problems in mc-4.6.1 connected to do_enter_ca_mode() and
do_exit_ca_mode() functions.
Also I've written patch solving them (as it seems to me, at least:-)

1). do_enter_ca_mode() and do_exit_ca_mode() functions use hardcoded values
for Termcap capabilities "ti" and "te" ("smcup" and "rmcup" in Terminfo
terms). But, for example, FreeBSD/termcap xterm definition looks like
-- xterm| xterm-color|X11 terminal emulator:\
-- :ti@:te@:tc=xterm-xfree86:
i.e. this capabilities are declared as absent. Other xterm-like terminals
have other values, differs from hardcoded.
* I offer to detect this values during startup using SLang/curses *getstr

2). do_enter_ca_mode() do nothing when called during startup, because
xterm_flag is always zero at that moment.
* I offer to add do_enter_ca_mode() call to init_xterm_support() function.

3). do_exit_ca_mode() is not called on shutdown if ncurses library used,
even if do_enter_ca_mode() was called previously.
* I offer to add do_exit_ca_mode() to shutdown block.

4). Both do_enter_ca_mode() and do_exit_ca_mode() uses fprintf(stdout,...),
but "man curs_terminfo" recommends putp() using.
* I offer to replace fprintf() call with putp().

And the last:
I've changed "xmouse_seq" determinining in the init_xterm_support()
function. Termcap/Terminfo structures are already initialized at that
moment, there is no need to call SLtt_tigetent(). More, it is better to call
SLtt_tgetstr() because it works in both Slang/Termcap and Slang/Terminfo
cases, in opposite to SLtt_tigetstr(), wich works in Slang/Terminfo case

The patch for all things is attached.

Thanks for attention.
If there are any mistakes or misunderstandings here, point me to them,
please :-)

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

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

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