Kazutaka YOKOTA wrote (1999/12/03):
> This strange behavior was reported several times in the past.  It must
> be related to screen update logic in syscons. But, I don't think we
> have successfully fixed it at that time :-(
> It's time to analyze the problem again...

Yes. I know about this problem too but I have no time to fix and test
it. Is anybody interested in bug reports? ;-)

* Left margin moving to the right is related to the screen width not
  divisible by 8 and an use of tabulators at the end of line after the
  last valid tab position. So the same problem could be seen for
  example with screen width 90, which is accessible for all
  -current users: Let's suppose that cursor range is 0..89: If the
  cursor is on 80..87, it will move to position 88 and everything is ok.
  If the cursor is on 88..89, the position is calculated properly (you
  can switch to another console then return and cursor will be on
  the right position on column 0), but cursor is moved incorrectly
  on column 8 on the next line and next lines are moved to the left too
  until you switch between consoles.
  I think the fix should be trivial (syscons.c,v 1.327) - but it is
  speculated right now without testing:

--
*** syscons.c   Sun Nov 28 15:29:28 1999
--- /tmp/syscons.c      Fri Dec  3 10:28:59 1999
***************
*** 2946,2956 ****
        case 0x09:  /* non-destructive tab */
            mark_for_update(scp, scp->cursor_pos);
            scp->cursor_pos += (8 - scp->xpos % 8u);
-           mark_for_update(scp, scp->cursor_pos);
            if ((scp->xpos += (8 - scp->xpos % 8u)) >= scp->xsize) {
                scp->xpos = 0;
                scp->ypos++;
            }
            break;
  
        case 0x0a:  /* newline, same pos */
--- 2946,2957 ----
        case 0x09:  /* non-destructive tab */
            mark_for_update(scp, scp->cursor_pos);
            scp->cursor_pos += (8 - scp->xpos % 8u);
            if ((scp->xpos += (8 - scp->xpos % 8u)) >= scp->xsize) {
                scp->xpos = 0;
                scp->ypos++;
+               scp->cursor_pos = scp->xsize * scp->ypos;
            }
+           mark_for_update(scp, scp->cursor_pos);
            break;
  
        case 0x0a:  /* newline, same pos */
--

* There are another problems with syscons updating: When a block
  of text is selected by mouse, it should be hidden when text in this
  block is changed. Unfortunately in many cases the block stays
  selected on the same position... I think we should learn from
  xterm. (But when I tested xterm, it had some problems too...)

  I have created small testing script which can show
  all upcoming problems (I think). But in some cases you have to know
  which block of text should be selected...

--
#!/usr/local/bin/bash

c_before()
{
        tput clear
        I=20
        while [ $I -gt 0 ]; do
                echo "$I $I $I $I $I $I $I $I $I $I $I $I $I $I $I $I $I $I $I $I"
                I=`expr $I - 1`
        done
        tput sc ; tput cm $1 $2 ; echo -n "*" ; tput rc
        echo "Mark a block and then press Enter and after test too..."
        read Q
        tput cm $1 $2
}

c_after()
{
        read Q
        clear
}

c_cycle()
{
        I=$1
        while [ $I -gt 0 ]; do
                echo -n $2
                I=`expr $I - 1`
        done
}

c_print()
{
        tput cm 89 8
        printf "\t\nThis text must start at the beginning of the line!\n"
}

clear
PS3="Which test? "
select X in Tab Text Mu1 El0 El1 El2 Il1 Dl1 Dc1 Ic1 Su1 Sd1 Ec1 Sw1 Quit ; do
        if [ -z "$X" ]; then
                echo "Unknown selection"
                break
        fi
        if [ $X = Quit ]; then
                break
        fi
        c_before 40 8
        case $X in
        Tab)    c_print ;;              # Bug - 90x30 and tab at the end of line
        Text)   c_cycle 4 "Text " ;;    # Bug - remove_markings
        Mu1)    c_cycle 22 "M" ;;      # Bug - remove_markings
        El0)    c_cycle 1 "" ;;     # Bug - remove_markings
        El1)    c_cycle 1 "" ;;     # Bug - remove_markings
        El2)    c_cycle 1 "" ;;     # Bug - remove_markings
        Il1)    c_cycle 5 "" ;;     # Bug - remove_markings
        Dl1)    c_cycle 5 "" ;;     # Bug - remove_markings
        Dc1)    c_cycle 10 "" ;;    # Bug - remove_markings
        Ic1)    c_cycle 10 "[1@" ;;    # Bug - remove_markings
        Su1)    c_cycle 10 "" ;;    # Bug - remove_markings
        Sd1)    c_cycle 10 "" ;;    # Bug - remove_markings
        Ec1)    c_cycle 1 "" ;;    # Bug - remove_markings
        Sw1)    c_cycle 1 "" ;;   # Bug - don't beep after this
        esac
        c_after
done
--

I have a fast-partial-fix for syscons.c,v 1.308. But please don't apply
this patch - it should be much more intelligent than following patch -
the block is hidden in all cases but I would like to see solution
similar to xterm - a block is hidden only in needed cases.

--
*** syscons.c   Thu Jun 24 20:14:56 1999
--- syscons.c.new       Thu Jun 24 20:16:52 1999
***************
*** 2442,2447 ****
--- 2442,2448 ----
                sc_vtb_ins(&scp->vtb, 0, scp->xsize,
                           sc->scr_map[0x20], scp->term.cur_color);
                mark_all(scp);
+               sc_remove_cutmarking(scp);
            }
            break;
  #if notyet
***************
*** 2567,2572 ****
--- 2568,2574 ----
                mark_for_update(scp, scp->cursor_pos);
                mark_for_update(scp, scp->cursor_pos +
                                scp->xsize - 1 - scp->xpos);
+               sc_remove_cutmarking(scp);
                break;
            case 1: /* clear from beginning of line to cursor */
                sc_vtb_erase(&scp->vtb, scp->cursor_pos - scp->xpos,
***************
*** 2574,2579 ****
--- 2576,2582 ----
                             sc->scr_map[0x20], scp->term.cur_color);
                mark_for_update(scp, scp->ypos * scp->xsize);
                mark_for_update(scp, scp->cursor_pos);
+               sc_remove_cutmarking(scp);
                break;
            case 2: /* clear entire line */
                sc_vtb_erase(&scp->vtb, scp->cursor_pos - scp->xpos,
***************
*** 2581,2586 ****
--- 2584,2590 ----
                             sc->scr_map[0x20], scp->term.cur_color);
                mark_for_update(scp, scp->ypos * scp->xsize);
                mark_for_update(scp, (scp->ypos + 1) * scp->xsize - 1);
+               sc_remove_cutmarking(scp);
                break;
            }
            break;
***************
*** 2593,2598 ****
--- 2597,2603 ----
                       sc->scr_map[0x20], scp->term.cur_color);
            mark_for_update(scp, scp->ypos * scp->xsize);
            mark_for_update(scp, scp->xsize * scp->ysize - 1);
+           sc_remove_cutmarking(scp);
            break;
  
        case 'M':   /* Delete n lines */
***************
*** 2603,2608 ****
--- 2608,2614 ----
                          sc->scr_map[0x20], scp->term.cur_color);
            mark_for_update(scp, scp->ypos * scp->xsize);
            mark_for_update(scp, scp->xsize * scp->ysize - 1);
+           sc_remove_cutmarking(scp);
            break;
  
        case 'P':   /* Delete n chars */
***************
*** 2615,2620 ****
--- 2621,2627 ----
                         sc->scr_map[0x20], scp->term.cur_color);
            mark_for_update(scp, scp->cursor_pos);
            mark_for_update(scp, scp->cursor_pos + n + count - 1);
+           sc_remove_cutmarking(scp);
            break;
  
        case '@':   /* Insert n chars */
***************
*** 2627,2632 ****
--- 2634,2640 ----
                         sc->scr_map[0x20], scp->term.cur_color);
            mark_for_update(scp, scp->cursor_pos);
            mark_for_update(scp, scp->cursor_pos + n + count - 1);
+           sc_remove_cutmarking(scp);
            break;
  
        case 'S':   /* scroll up n lines */
***************
*** 2636,2641 ****
--- 2644,2650 ----
            sc_vtb_delete(&scp->vtb, 0, n * scp->xsize,
                          sc->scr_map[0x20], scp->term.cur_color);
            mark_all(scp);
+           sc_remove_cutmarking(scp);
            break;
  
        case 'T':   /* scroll down n lines */
***************
*** 2645,2650 ****
--- 2654,2660 ----
            sc_vtb_ins(&scp->vtb, 0, n * scp->xsize,
                       sc->scr_map[0x20], scp->term.cur_color);
            mark_all(scp);
+           sc_remove_cutmarking(scp);
            break;
  
        case 'X':   /* erase n characters in line */
***************
*** 2655,2660 ****
--- 2665,2671 ----
                         sc->scr_map[0x20], scp->term.cur_color);
            mark_for_update(scp, scp->cursor_pos);
            mark_for_update(scp, scp->cursor_pos + n - 1);
+           sc_remove_cutmarking(scp);
            break;
  
        case 'Z':   /* move n tabs backwards */
--

-- 
Rudolf Cejka   ([EMAIL PROTECTED];  http://www.fee.vutbr.cz/~cejkar)
Brno University of Technology, Faculty of El. Engineering and Comp. Science
Bozetechova 2, 612 66  Brno, Czech Republic


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message

Reply via email to