HTMLterm?



Although I don't code much (or, for that matter, terribly well ;), I had an Idea(tm) for an extension to Gnome:

Wouldn't it be cool to have an rxvt-like window capable of rendering HTML - or something very much like it?

'cooked'-CLI programs could be enhanced and made graphical simply by adding tags to their output. Imagine table-formatted 'ls' results, and '--help' information that not only describes what each command-line option does, but a series of html forms to set them in the *.rc file as well! A built-in web browser could become simply a matter of shell scripting. Link choices, forms, etc could communicate back to the program via 'response' tags, ie a click on a URL could be translated by the htmlterm to 'programname '<open>http://www.blah.net</open>' and sent bakc to 'programname' along stdin.. The actual name of the program, and various initial settings (background colour/pattern) could be communicated by, say, a <program> tag at the beginning of program output. 
But I'm rambling. Here's an example of a possible htmlterm session, under the hood, with comments denoted by  '#' and user input by quotes.


#htmlterm is launched.
<program name="bash" bgcolor=#FFFFFF>bash$
 "ls -l"
#bash writes:
</program>
#ls, detecting that the HTMLTERM environment variable is set, writes:
<program name="ls" bgcolor="red"><table><tr><td width=25%>foo.tgz
....
</table></program>
#bash resumes control of the prompt:
<program name="bash" bgcolor=#FFFFFF>bash$
#user, bored with 'ls', decides to run the popular sysconfig tool 'quux':
"quux --bad_option_of_some_specified_nature"
#bash outputs:
</program> #and then calls quux.
#quux outputs:
<program name="quux" bgcolor=#F0F0F0>
<h3>Sorry, that option is not understood.</h3>
Valid options are:
<p>
<form method="term" action="quux --configure $_">
Verbosity: <select name="goto"><option value="-V">...</select>
...
#note that, as a very early beta, 'quux' fails to close its tags properly. However, the <program> tag spat out by bash acts in a fashion similar to a '<tr><td>' in normal html, in that unclosed tags are fixed and sins are forgiven. Bash writes:

<program name="bash" bgcolor=#FFFFFF>
#The user now runs an ancient, pre-gnome, pre-linux 2.4.x binary called 'vi'. ;) Not aware of (or in need of) htmlterm, it doesn't use a <program> tag. So when bash prints:
</program>
#htmlterm becomes a standard, plain-jane, vanilla term, until reactivated by bash's <program> tag.


Okay, you guys get the idea now. Savvy program would be able to output graphical, hyperlinked UIs  on the prompt whilst unknowing applications (or uncaring applications, or applications in which html parsing would get in the way) could simply neglect to prefix its output with <program>. This would be pretty neet, esp. considering that windows, et al, seem to be moving in the direction of an html-based interface anyway. Besides, the idea of unix' supposedly outdated CLI leapfrogging giants like Microsoft because Everything Old Is New Again gives me a warm and fuzzy. An html, term-based GUI would embrace not only modern UI models, but also the proud, efficient tradition that is the unix heritage. Yadda yadda.  

On the down side, some (most?) shells would have to be patched in order to make the scheme work. Also, security concerns might become an issue: A luser on IRC could casually mention '<APPLET CLASS="trojan.class">' and watch your home directory erase itself. Perhaps the term could be designed to throw up warnings before going outside the box for images, applets, etc.

I hope this is of use to somebody. God knows I'll never cast off sufficient apathy to write such a program. I'm just so sick of everybody and their dog copying a UI concept from Microsoft and Friends when we have a perfectly good model right under our noses, albeit one sorely in need of an update.  

-- 
CP/M
The obvious mathematical breakthrough [to break modern encryption]
would be development of an easy way to factor large prime numbers.
        --Bill Gates from "The Road Ahead," p. 265.         



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]