[Toybox] Editors and such.
Rob Landley
rob at landley.net
Fri Jun 22 06:52:33 PDT 2012
On 06/21/2012 12:00 AM, David Seikel wrote:
> On Wed, 20 Jun 2012 18:57:03 -0500 Rob Landley <rob at landley.net> wrote:
>
>> On 06/18/2012 10:10 PM, Andre Renaud wrote:
>>>> No, they have an implementation of screen. The first one I used
>>>> (circa 1993) was from Sun.
>>>>
>>>> The wonkypedia article says the first pair of maintainers handed
>>>> it over to a second pair of maintainers who handed it over to the
>>>> gnu project. So it's a bit like Gold and Patch and Grub and EGCS
>>>> so on: somebody wrote a thing that worked and the Gnu project
>>>> managed to take it over and plaster their name all over it as the
>>>> versions they ship bloat and lose reliability.
>>>
>>> There is a BSD-licensed terminal multiplexer - 'tmux'. It's
>>> conceptually the same as GNU screen, but I'm assuming it's a
>>> completely clean code base.
>>
>> I wrote a terminal multiplexer for my old "chamelyn" bulletin board
>> system as a teenager. (DOS with Desqview. Those were the days. Well,
>> some of 'em anyway.)
>>
>> All the tabbed browsing terminals are also terminal multiplexers. In
>> Linux, ptys make it easy.
>>
>> The fiddly part is curses output, but the line handling stuff for
>> editing a shell command line and doing command line history is 90% of
>> the work, and then stacking those vertically gets you something like
>> vi. (That was my general plan of attack, anyway.)
>>
>> Keep in mind that Unix doesn't implement backspace sanely (like the
>> commodore 64 did), thus you have to figure out when you're at the left
>> edge of the screen (keeping track of your cursor position)
>>
>> That's why if you do "echo -n this will screw bash up" and then cursor
>> up a few times bash's command history gets all wonky because it
>> _thinks_ it knows where the cursor is but actually started farther to
>> the right. (I contributed ansi escape screen position querying code
>> to busybox to improve the situation for ash.)
>>
>> I'm pretty sure I blogged about this... Recentish:
>>
>> http://landley.net/notes-2011.html#15-11-2011
>>
>> During toybox's first regeneration:
>>
>> http://landley.net/notes-2007.html#19-10-2007
>
> I was pretty much coming to the conclusion that I would have to write
> something that smells like readline. Sounds like you agree.
toysh needs readline. less needs readline (forward slash searches). vi
not only needs it for colon mode, but implemented correctly the rest of
it could be _built_ on top of it. And once you have "manage a text
buffer, respond to escapes" pretty much any text editor becomes a config
file for this (although vi is the only one required by posix). And then
there's screen...
> I'm half tempted to implement tabbed boxes as well, but that would be
> low priority
Managing an area of the screen other than the current screen size
shouldn't be too big a deal.
Rob
--
GNU/Linux isn't: Linux=GPLv2, GNU=GPLv3+, they can't share code.
Either it's "mere aggregation", or a license violation. Pick one.
1340373153.0
More information about the Toybox
mailing list