Anybody want to fix ash's backspace line wrap?

Matthew Hiles matthew.hiles at gmail.com
Sun May 17 15:16:56 UTC 2009


Cathey, Jim wrote:
>> * if neither $LINES/$COLUMNS are set nor ioctl(TIOCGWINSZ)
>>  returns useful data, print
>>  ESC"7" ESC"[r" ESC"[9999;9999H" ESC"[6n" ESC"8"
>>  in order to retrieve terminal's size, and whenever read_key
>>  does detect that, use this info for proper linewrapping
>>  in line editing.
>>     
>
> TERM should be consulted somehow, so that it concludes an
> ANSI escape sequence is the correct thing to do.  Don't know
> what, if anything, BB's got in that line.
>
>   
>> Sure, the "wall" program...will screw 
>> up your display.  So what?
>>     
>
> So you need a way to recover the view of the line you're
> currently editing _anyway_.  Given this, it can _also_ be used
> to recover from the weird "echo -n" scenario under discussion,
> or anything else odd.  No blotted output, no vast sweeping changes
> of code, no dependence on bug-free full VT emulation, etc.  No
> vulnerability to interleaved user input and automated response
> sequences.  Just a simple user reaction to an exceptional
> condition, no muss, no fuss.  Something look odd?  Just call
> for a repaint and see where you are.
>
>   
>> Which says vt100 actually _does_ support the esc[6n "Get cursor
>>     
> position" 
>   
>> sequence.
>>     
>
> Real VT's do, but this is one of the areas where various terminal
> emulation software can fall down easily.  BTDT.  Make it too tricky
> and you're opening the door for unhappy users.  Unless you're
> into forced upgrading of associated SW just for the fun of it.
> (Ala MSoft.  Is Linux the new DOS?)
>
> I'm talking about _less_ work for an entirely acceptable solution,
> that's all.  One that was generally accepted for decades, with 
> untold thousands of satisfied users.  One with more likelihood
> of working in more situations and with more varied terminal
> clients, even over very slow satellite links.  What's not to like?
>
> -- Jim
>
>
>
>
> _______________________________________________
> busybox mailing list
> busybox at busybox.net
> http://lists.busybox.net/mailman/listinfo/busybox
>
>   

I've been casually following the discussion and thought I'd chime in 
with my two cents. I haven't read every single email, so forgive me if 
I'm asking things already addressed.

I don't think adding a whole lot of iffy terminal stuff is the best 
approach. If you're in the middle of typing a command and can't get back 
to the first line in bash, just hit ctrl-u, ctrl-y. I assume it wouldn't 
be too difficult to add ctrl-y (paste) to bb shells?

Besides that, what's wrong with just pressing enter once if your prompt 
didn't start at the first column?

And thirdly, what about prefixing your prompt with a \n?

~Matthew


More information about the busybox mailing list