<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>Individuation Again</title><link>http://blog.orebokech.com/</link><description>Romain Francoise's blog</description><atom:link href="http://blog.orebokech.com/index.xml" type="application/rss+xml" rel="self"></atom:link><lastBuildDate>Fri, 20 Jul 2012 19:09:57 GMT</lastBuildDate><generator>ConveyorBelt v5</generator><docs>http://cyber.law.harvard.edu/rss/rss.html</docs><item><title>Getting clickable URLs in xterm (sort of)</title><link>http://blog.orebokech.com/2012/07/clickable-urls-in-xterm.html</link><description>&lt;p&gt;My terminal emulator of choice is &lt;a href="http://invisible-island.net/xterm/"&gt;xterm&lt;/a&gt;: it's fast, light, and
(since it's pretty much the reference implementation) it has excellent
support for everything a console user could desire... except for one
thing that would be very, very convenient: making URLs clickable. Other
terminal emulators have this feature, but they also have problems that
make them inferior to xterm in different ways.&lt;/p&gt;
&lt;p&gt;Over the years people have come up with various workarounds for this
situation, like screen scraping utilities (&lt;a href="http://packages.debian.org/urlview"&gt;urlview&lt;/a&gt;, &lt;a href="http://packages.debian.org/urlscan"&gt;urlscan&lt;/a&gt;)
that can be &lt;a href="https://wiki.archlinux.org/index.php/Tmux#Browsing_URL.27s"&gt;hooked up to other console programs&lt;/a&gt; to extract and
browse URLs, but they're still not as convenient as just using the
mouse, and often require the program to run on the same machine as the
browser.&lt;/p&gt;
&lt;p&gt;Fortunately, &lt;a href="http://invisible-island.net/xterm/xterm.log.html#xterm_277"&gt;xterm #277&lt;/a&gt; (released in January 2012) added a new
feature that provides almost exactly what I had been looking for: it can
now spawn programs using the &lt;code&gt;exec-formatted&lt;/code&gt; action and give them as
argument the contents of the current selection or clipboard. So you can
add the following to your &lt;code&gt;~/.Xresources&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;*VT100*translations: #override Meta &amp;lt;Btn1Up&amp;gt;: exec-formatted("x-www-browser '%t'", PRIMARY)&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;which makes xterm run &lt;code&gt;x-www-browser&lt;/code&gt; on the selection when it receives
Alt + left click. (Adjust for whatever your Meta key is.)&lt;/p&gt;
&lt;p&gt;This is advantageously combined with a &lt;code&gt;charClass&lt;/code&gt; setting to make xterm
treat URLs as a single word, so that you can just double-click on them
to select them:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;XTerm*charClass: 33:48,36-47:48,58-59:48,61:48,63-64:48,95:48,126:48&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;With both of these enabled, opening URLs is now just a matter of:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Double-clicking the URL to select it&lt;/li&gt;
&lt;li&gt;Doing Alt + click anywhere on the xterm window to run the browser&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;which, while more involved than a single click, it still much faster
than having to copy the URL manually to the browser.&lt;/p&gt;</description><guid isPermaLink="true">http://blog.orebokech.com/2012/07/clickable-urls-in-xterm.html</guid><pubDate>Sat, 14 Jul 2012 16:12:02 GMT</pubDate></item></channel></rss>