zsh-users
 help / color / mirror / code / Atom feed
* Zsh as Application Platform
@ 2012-09-30  5:57 ☈king
  2012-09-30 16:23 ` Peter Stephenson
  0 siblings, 1 reply; 2+ messages in thread
From: ☈king @ 2012-09-30  5:57 UTC (permalink / raw)
  To: zsh-users

Guys.

Idea
----

Zsh has one of the sweetest CLI interactors around.  Readline's chumpy.
Language-specific libs are weak+tedious+incomplete. The best hand-made
implementations will take a very long time to make and still probably
would never be as easily customized as zle.

So, can't we use zsh as the front-end for other tools, to much great
winning profit power?

Example: Pry
------------

Look at the great Ruby REPL, Pry ( http://pryrepl.org/ ).

It comes out of the box using readline, which is sort of nice because
readline is sort of nice. But it hits limits very quickly.  Check out
the gnarly hack used here to add just a single keybinding to the REPL: 
https://github.com/tpope/pry-editline/blob/master/lib/pry-editline.rb#L11

An alternative is provided via a pure-Ruby alternative, Coolline, but
it's implementation is not sophisticated (has no vi keys; hardcodes
terminal escape sequences), and ended up getting special handling
directly inside pry:
https://github.com/pry/pry/blob/master/lib/pry/pry_instance.rb#L605

So
---

Are there any tools that already do something like this?

I think I could start by simply making ^J/^M do something other than
accept-line (that is, send their buffer to another program via IPC), and
start working on custom completion. But, if there's prior art, I'd like
to study it first.

Thanks!
—☈


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Zsh as Application Platform
  2012-09-30  5:57 Zsh as Application Platform ☈king
@ 2012-09-30 16:23 ` Peter Stephenson
  0 siblings, 0 replies; 2+ messages in thread
From: Peter Stephenson @ 2012-09-30 16:23 UTC (permalink / raw)
  To: zsh-users

On Sun, 30 Sep 2012 00:57:23 -0500
☈king <rkingdesk@sharpsaw.org> wrote:
> So, can't we use zsh as the front-end for other tools, to much great
> winning profit power?

It's tricky if the object is to build the zsh line editor into other
tools; it's hard to prise it away from the shell.

One thing that is relatively straightforward using the TCP support in
the shell and the TCP function system is to have an existing shell send
and receive commands from a TCP session which could simply be a command
line tool reading from and writing to a socket; you just need a simple
front-end to point the existing application at the socket rather than a
terminal.  I've been using this for many years at work to talk to
otherwise rather limited command line environments.

-- 
Peter Stephenson <p.w.stephenson@ntlworld.com>
Web page now at http://homepage.ntlworld.com/p.w.stephenson/


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-09-30 16:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-09-30  5:57 Zsh as Application Platform ☈king
2012-09-30 16:23 ` Peter Stephenson

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).