[dev] [st] patch to send terminal to another program

From: Nick <suckless-dev_AT_njw.me.uk>
Date: Thu, 25 Aug 2011 15:40:56 +0100

I think it would be really neat to be able to send all the
text in a terminal to an external program, to act on it as
it likes.

I wrote a patch to do that, sending the contents of the
screen to the stdin of the chosen program.

One good use for this is writing a script to find any links,
and offer to open them in a browser using dmenu. A
particularly crude version of this could be:

#!/bin/sh
sed -e '/http/!d' -e 's/.*http/http/g' -e 's/ .*//g' | dmenu | xargs surf

There are a couple of things which need fixing / could do
with some discussion:

1) At present I commented out the SIGCHLD handler, as it was
blocking the process from returning. I confess to not being
overly familiar with the finer points of forking, so hope
someone better than me can suggest a fix.

2) This could be a feature that people would find useful to
trigger several different scripts. At present the key
binding is hardcoded (meta-|); should we add something to
be able to better define keybindings in config.h?

Received on Thu Aug 25 2011 - 16:40:56 CEST

This archive was generated by hypermail 2.2.0 : Thu Aug 25 2011 - 16:48:03 CEST