[BUG] vi misbehaves on pasted text

John Spencer maillist-busybox at barfooze.de
Mon Jun 11 01:03:13 UTC 2012


On 06/11/2012 01:53 AM, Denys Vlasenko wrote:
> On Saturday 09 June 2012 22:54, John Spencer wrote:
>> somehow the leading whitespace seem to confuse vi or maybe it's trying
>> to auto-indent...
>>
> ":set noai" turns it off.
> I am making it the default...
thanks, much appreciated.

>> another annoyance is that it doesnt reset the terminal on exit,
>> effectively deleting the last H lines from the screen, where H is the
>> height of the term.
> Please explain more, I don't understand the problem.

when you leave bb vi, whatever you looked at in the editor will stay on 
the screen.
the last few (H) lines you had on the screen previously are lost.

other editors restore the terminal content to what it was before the 
editor was launched, so you can still read your previous screen content.

in other words: if your term height is 25 lines, and you do: seq 50, 
then open a file in vi, then exit, you will have 1-25 still in your 
scrollback buffer, but 26-50 are lost.

the usual ncurses "fullscreen" program uses the following cleanup code:
     clear();
     refresh();
     endwin();

the termios equivalent to one of those (probably endwin()) doesn't seem 
to get called by bb vi.





More information about the busybox mailing list