vi scrolling issue

Hello,
I am using poderosa to open a terminal in an aix box.
The problem is when i use a sudo, the vi scroll doesnt work properly,

It will scroll through the first page, but when it reaches the end, only the last line scrolls, not the whole screen, making it hard to read and work.
Its like the whole screen freezes and only the last line is functional

Is this relating to a problem between windows telnet and unix like described here Telnet Using UNIX Vi Editor May Scroll Improperly

OR

If possible someone can tell me why this happens

The problem is an incorrect setting of the "$TERM" environment variable.

Any program trying to do "more fancy" things on a terminal (vi, for instance, has to write to random positions on the screen to update it, not only streams of output like "ls") first evaluates this variable, then looks into the "termcap" database. In this database there are escape sequences for every capability (hence the name) and the program will use these. One such capability could be to position the cursor, another to switch to reverse video, another to switch back, asf. This is how vi (and programs like it: less, view, ...) handle different terminals types without having to take care of these themselves: the termcap database.

So far the theory. ;-))

The Windows telnet is notorious for setting the terminal type to "ansi" while in fact emulating a vt100 terminal. Therefore: issue the line

export TERM=vt100

and everything should be fine. If you have similar troubles again use

echo $TERM

to display the variables current value.

I hope this helps.

bakunin