slang-users mailing list

[2001 Date Index] [2001 Thread Index] [Other years]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]

Re: Fix for "ugly border" bug


Hello, John!

Sorry that the previous message was a bit terse and lacked some important
data. Now I'll try to write a bugreport aimed at S-Lang developers.

> >The bug shown here http://www.red-bean.com/~proski/mc.png is actually a
> >bug in SLang 1.x including the latest version 1.4.4, but not 0.99.38.
>
> What Unix-variant are you using?  Is it *BSD or SCO?  In any case,

RedHat Linux 7.1, rxvt 2.6.2. CVS version of GNU Midnight Commander
(4.5.54 behave the same way),

> please try this:
>
>     cd slang/src
>     make untic
>     ./untic > /tmp/untic.log
>
> Then email /tmp/untic.log to me.  I am curious about your alternate
> character set definitions.

I think you are interested in the following lines:

ae=^O           exit_alt_charset_mode
as=^N           enter_alt_charset_mode
eA=^[(B^[)0             enable alternate char set

The full output is attached.

I hacked SLtt_set_alt_char_set() to output text messages instead of the
standard strings. As a side note, it would be nice to have a debugging
terminal definition - this would make it easier to read the output without
hacking the code.

From what I can see, S-Lang changes to the alt charset mode and outputs a
lot of stuff. At some point the terminal resets to the normal mode, but
S-Lang doesn't know about that.

If we force S-Lang to output something in the middle of the output, the
terminal gets in-sync with S-Lang.

I also know that if I disable caching in SLtt_set_alt_char_set() the frame
is drawn correctly. Again, we have more synchonization points, so the bug
is hidden.

The right solution is probably to find out which sequence resets (or may
reset?) the terminal to the normal charset mode and make S-Lang aware of
this change (or possible of change).

I'm attaching two output logs of MC. They were taken under the following
conditions.

RedHat 7.1 i386, CVS MC, S-Lang 1.4.4.  Configured as

CFLAGS=-g ./configure --without-gnome --without-subshell --without-edit
--without-gpm-mouse --without-vfs --disable-nls --with-slang=/usr/local

to remove all unneeded stuff and simplify debugging. Changes in MC -
removed noasc() and asc() in src/widget.c for the "fixed" pass (this was
my workaround), prompt set to "" in main.c (needed to reproduce the bug
without subshell support).

Changes in S-Lang: SLtt_set_alt_char_set() prints descriptive strings.

Procedure:

./mc /var/tmp /var/tmp >log
Press F10, Enter.

log.old - for the code without workaround - works incorrectly.
log.fixed - for the code with workaround - works "correctly".

-- 
Regards,
Pavel Roskin
--- src/main.c
+++ src/main.c
@@ -3176,7 +3176,8 @@ main (int argc, char *argv [])
 		prompt = "";
 	} else
 #   endif
-	    prompt = (geteuid () == 0) ? "# " : "$ ";
+//	    prompt = (geteuid () == 0) ? "# " : "$ ";
+prompt = "";
 
     /* Program main loop */
     do_nc ();
--- src/widget.c
+++ src/widget.c
@@ -849,10 +849,10 @@ update_input (WInput *in, int clear_firs
      * characters. Subshell support and color terminal are needed for
      * the bug to show up.
      */
-    acs ();
+//    noacs ();
     SLsmg_fill_region (in->widget.y, in->widget.x,
 		       1, in->field_len - has_history, ' ');
-    noacs ();
+//    noacs ();
 #else
     widget_move (&in->widget, 0, 0);
     for (i = 0; i < in->field_len - has_history; i++)
--- sldisply.c
+++ sldisply.c
@@ -1256,7 +1256,7 @@ void SLtt_set_alt_char_set (int i)
    static int last_i;
    if (SLtt_Has_Alt_Charset == 0) return;
    if (i == last_i) return;
-   tt_write_string (i ? Start_Alt_Chars_Str : End_Alt_Chars_Str );
+   tt_write_string (i ? "\nStart_Alt_Chars_Str\n" : "\nEnd_Alt_Chars_Str\n" );
    last_i = i;
 }
 
xterm|X11 terminal emulator
	@1=^[OE		begin key
	@7=^[[4~		Key End
	@8=^[OM		enter/send key
	AB=^[[4%p1%dm		set ANSI color background
	AF=^[[3%p1%dm		set ANSI color foreground
	AL=^[[%p1%dL		parm_insert_line
	DC=^[[%p1%dP		delete #1 chars
	DL=^[[%p1%dM		parm_delete_line
	DO=^[[%p1%dB		down #1 lines
	F1=^[[23~		key_f11
	F2=^[[24~		key_f12
	F3=^[[25~		key_f13
	F4=^[[26~		key_f14
	F5=^[[28~		key_f15
	F6=^[[29~		key_f16
	F7=^[[31~		key_f17
	F8=^[[32~		key_f18
	F9=^[[33~		key_f19
	FA=^[[34~		key_f20
	IC=^[[%p1%d@		insert #1 chars
	K1=^[Ow		upper left of keypad
	K2=^[Oy		center of keypad
	K3=^[Ou		upper right of keypad
	K4=^[Oq		lower left of keypad
	K5=^[Os		lower right of keypad
	Km=^[[M		Mouse event has occurred
	LE=^[[%p1%dD		move #1 chars to the left
	RA=^[[?7l		turn off automatic margins
	RI=^[[%p1%dC		parm_right_cursor
	SA=^[[?7h		turn on automatic margins
	Sb=^[[4%?%p1%{1}%=%t4%e%p1%{3}%=%t6%e%p1%{4}%=%t1%e%p1%{6}%=%t3%e%p1%d%;m		set background (color)
	Sf=^[[3%?%p1%{1}%=%t4%e%p1%{3}%=%t6%e%p1%{4}%=%t1%e%p1%{6}%=%t3%e%p1%d%;m		set foreground (color)
	UP=^[[%p1%dA		up #1 lines
	ac=``aaffggiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~		acs_chars
	ae=^O		exit_alt_charset_mode
	al=^[[L		insert line
	as=^N		enter_alt_charset_mode
	bl=^G		audible signal (bell)
	bt=^[[Z		back tab
	cb=^[[1K		Clear to beginning of line
	cd=^[[J		clear to end of screen
	ce=^[[K		clr_eol
	ch=^[[%i%p1%dG		horizontal position #1, absolute
	cl=^[[H^[[2J		clear screen and home cursor
	cm=^[[%i%p1%d;%p2%dH		move to row #1 columns #2
	cr=^M		carriage return
	cs=^[[%i%p1%d;%p2%dr		change region to line #1 to line #2
	ct=^[[3g		clear all tab stops
	cv=^[[%i%p1%dd		vertical position #1 absolute
	dc=^[[P		delete character
	dl=^[[M		delete line
	do=^J		down one line
	eA=^[(B^[)0		enable alternate char set
	ec=^[[%p1%dX		erase #1 characters
	ei=^[[4l		exit insert mode
	ho=^[[H		home cursor (if no cup)
	im=^[[4h		enter insert mode
	is=^[[!p^[[?3;4l^[[4l^[>		initialization string
	k1=^[OP		F1 function key
	k2=^[OQ		F2 function key
	k3=^[OR		F3 function key
	k4=^[OS		F4 function key
	k5=^[[15~		F5 function key
	k6=^[[17~		F6 function key
	k7=^[[18~		F7 function key
	k8=^[[19~		F8 fucntion key
	k9=^[[20~		F9 function key
	k;=^[[21~		F10 function key
	kD=^[[3~		delete-character key
	kI=^[[2~		insert-character key
	kN=^[[6~		next-page key
	kP=^[[5~		prev-page key
	kb=		backspace key
	kd=^[OB		down-arrow key
	ke=^[[?1l^[>		leave 'keyboard_transmit' mode
	kh=^[[1~		home key
	kl=^[OD		left-arrow key
	kr=^[OC		right-arrow key
	ks=^[[?1h^[=		enter 'keyboard_transmit' mode
	ku=^[OA		up-arrow key
	le=^H		move left one space
	mb=^[[5m		turn on blinking
	md=^[[1m		turn on bold (extra bright) mode
	me=^[[m^O		turn off all attributes
	mk=^[[8m		turn on blank mode (characters invisible)
	mr=^[[7m		turn on reverse video mode
	nd=^[[C		move right one space
	op=^[[39;49m		Set default pair to its original value
	pf=^[[4i		turn off printer
	po=^[[5i		turn on printer
	ps=^[[i		print contents of screen
	r1=^[c		reset string
	r2=^[[!p^[[?3;4l^[[4l^[>		reset string
	rc=^[8		restore cursor to last position of sc
	sa=^[[0%?%p1%p6%|%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;%?%p7%t;8%;m%?%p9%t^N%e^O%;		define video attributes #1-#9 (PG9)
	sc=^[7		save current cursor position
	se=^[[27m		exit standout mode
	sf=^J		scroll text up
	so=^[[7m		begin standout mode
	sr=^[M		scroll text down
	st=^[H		set a tab in every row, current columns
	ta=^I		tab to next 8-space hardware tab stop
	te=^[[?1047l^[[?1048l		strings to end programs using cup
	ti=^[[?1048h^[[?1047h		string to start programs using cup
	u6=^[[%i%d;%dR		User string #6
	u7=^[[6n		User string #7
	u8=^[[?1;2c		User string #8
	u9=^[[c		User string #9
	ue=^[[24m		exit underline mode
	up=^[[A		up one line
	us=^[[4m		begin underline mode
	vb=^[[?5h^[[?5l		visible bell (may not move cursor)
	ve=^[[?25h		make cursor appear normal (undo civis/cvvis)
	vi=^[[?25l		make cursor invisible
	vs=^[[?25h		make cursor very visible
	5i		printer won't echo on screen
	am		terminal has automatic margins
	km		Has a meta key, sets msb high
	mi		safe to move while in insert mode
	ms		safe to move while in standout mode
	ut		screen erased with background color
	xn		newline ignored after 80 cols (concept)
	Co#8		maximum numbers of colors on screen
	co#80		number of columns in aline
	it#8		tabs initially every # spaces
	li#24		number of lines on screen or page
	pa#64		maximum number of color-pairs on the screen

[2001 date index] [2001 thread index]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]