<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>BigSmoke &#187; XTerm</title>
	<atom:link href="http://blog.bigsmoke.us/tag/xterm/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.bigsmoke.us</link>
	<description>Smokes your problems, coughs fresh air.</description>
	<lastBuildDate>Sat, 04 Feb 2012 18:03:39 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Copy-pasting to and from XTerms</title>
		<link>http://blog.bigsmoke.us/2010/01/31/xterm-clipboard-selection</link>
		<comments>http://blog.bigsmoke.us/2010/01/31/xterm-clipboard-selection#comments</comments>
		<pubDate>Sun, 31 Jan 2010 18:17:42 +0000</pubDate>
		<dc:creator>Rowan Rodrik</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[CLIPBOARD]]></category>
		<category><![CDATA[PRIMARY]]></category>
		<category><![CDATA[X]]></category>
		<category><![CDATA[XTerm]]></category>

		<guid isPermaLink="false">http://blog.bigsmoke.us/?p=869</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p>By default, XTerms only supports the PRIMARY selection for copy and paste. The PRIMARY selection is the one that is used by most ‘modern’ X application when you select text. This text can then usually be pasted by clicking the middle/second mouse button. Because this selection is set whenever you select, it&#8217;s easily overwritten, often accidentally. That&#8217;s why most newer X apps offer a parallel copy/paste mechanism where the selection is only explicitly set by choosing “Cut” or “Copy” from the application&#8217;s “Edit” menu or from its context menu (or with the <kbd>Control-X/C/V</kbd> keyboard shortcuts). In X, this selection is called CLIPBOARD, just like in Windows where it&#8217;s the only selection.</p>

<p>X also has these selections called Cut Buffers, but these are considered obsolete. Maybe that&#8217;s just too bad, because they appear to be the only selections with persistence; the other selections, PRIMARY and CLIPBOARD, disappear when the application is quit. Apparently, this is a <em>feature</em>, because it enables <em>content negotiation</em>.</p>

<p>Anyway, XTerm can be configured to do anything and I want it to be CLIPBOARD aware, for two reasons: one is that I often copy things from applications that can <em>only</em> set the CLIPBOARD selection; another is that I want to be able to really <strong>copy</strong> something <em>from</em> the XTerm, without losing it as soon as I select something else (especially if that something else is something I want to replace with the selection).</p>

<p>So, I added the following to my <tt>VT100.Translations</tt> <tt>#override</tt> in <tt>.Xdefaults.XTerm</tt>:</p>

<pre>
XTerm*VT100.Translations: #override \
    Shift<Key>Insert: insert-selection(CLIPBOARD) \n\
    <Key>Insert: insert-selection(PRIMARY) \n\
    Shift<Btn2Up>: insert-selection(CLIPBOARD) \n\
    Shift<Btn1Down>: select-start() \n\
    Shift<Btn1Motion>: select-extend() \n\
    Shift<Btn1Up>: select-end(CLIPBOARD)
</pre>

<p>What this does:</p>

<ul>
<li>This gives me an XTerm that pastes the content of the CLIPBOARD when I hold down <kbd>Shift</kbd> during my two-finger tab (I&#8217;m using a touchpad, so that works as a <tt>Btn2</tt>).</li>
<li>Because I don&#8217;t like moving my hands, I can do the same by pressing <kbd>Shift+Insert</kbd>.</li>
<li>I can use my <kbd>Insert</kbd> key without <kbd>Shift</kbd> to paste the PRIMARY selection.</li>
<li>To copy something to the clipboard, I hold down the <kbd>Shift</kbd> key while making the selection.</li>
</ul>

<p>That&#8217;s how you can make use of the CLIPBOARD from your XTerm.</p>

<h2>Sources</h2>

<p>If you want to learn more.</p>

<ul>
<li><a href="http://www.jwz.org/doc/x-cut-and-paste.html">X Selections, Cut Buffers, and Kill Rings</a> by Jamie Zawinski</li>
<li><a href="http://linux.seindal.dk/2005/06/16/xterm-and-the-clipboard/">Xterm and the clipboard</a> by René Seindal</li>
</ul>]]></content:encoded>
			<wfw:commentRss>http://blog.bigsmoke.us/2010/01/31/xterm-clipboard-selection/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>XTerm configuration</title>
		<link>http://blog.bigsmoke.us/2009/11/18/xterm-configuration</link>
		<comments>http://blog.bigsmoke.us/2009/11/18/xterm-configuration#comments</comments>
		<pubDate>Wed, 18 Nov 2009 14:48:23 +0000</pubDate>
		<dc:creator>Rowan Rodrik</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[XTerm]]></category>

		<guid isPermaLink="false">http://blog.bigsmoke.us/?p=880</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p>I just created a <em><a href="http://gist.github.com/237901">gist</a></em> for my XTerm configuration (separated from the rest of my X resources). Here&#8217;s a snapshot of the current version:</p>

<pre>
XTerm*background: black
XTerm*Foreground: Grey

XTerm*faceName: Liberation Mono
XTerm*faceSize: 10

XTerm*on2Clicks: regex [^  \n]+

XTerm*bellIsUrgent: true

! Make the terminal 127 by 42 characters in size
XTerm*geometry: 127x44+64+0

! By default, XTerm composes special chars with META. With this setting I can work my readline magic instead.
XTerm*metaSendsEscape: true

! Bracketed paste mode requires the allowWindowOps resource to be true 
XTerm*allowWindowOps: true

XTerm*saveLines: 1000

! Don't jump to the bottom when there's output
XTerm*VT100*scrollTtyOutput: false

XTerm*VT100.Translations: #override \
    Shift<Key>Insert: insert-selection(CLIPBOARD) \n\
    <Key>Insert: insert-selection(PRIMARY) \n\
    Shift<Btn2Up>: insert-selection(CLIPBOARD) \n\
    Shift<Key>Up: scroll-back(1) \n\
    Shift<Key>Down: scroll-forw(1)


! vim: set syntax=xdefaults expandtab tabstop=4 shiftwidth=4:
</pre>]]></content:encoded>
			<wfw:commentRss>http://blog.bigsmoke.us/2009/11/18/xterm-configuration/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>My Window Maker &#8220;desktop&#8221; configuration</title>
		<link>http://blog.bigsmoke.us/2009/03/30/wmaker</link>
		<comments>http://blog.bigsmoke.us/2009/03/30/wmaker#comments</comments>
		<pubDate>Mon, 30 Mar 2009 11:36:20 +0000</pubDate>
		<dc:creator>Rowan Rodrik</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[WindowMaker]]></category>
		<category><![CDATA[wmaker]]></category>
		<category><![CDATA[X]]></category>
		<category><![CDATA[X11]]></category>
		<category><![CDATA[XTerm]]></category>

		<guid isPermaLink="false">http://blog.bigsmoke.us/?p=422</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p>During the ten years of my love-hate relationship with X-Windows, I&#8217;ve often tried and enjoyed using full-fledged desktop environment (starting with KDE and later sometimes GNOME too), but, given time, I always gravitate back to <a href="http://www.windowmaker.info/">WindowMaker</a>.</p>

<h2>XTerm</h2>

<p>I&#8217;m not so big on the whole desktop metaphor thing. The longer I&#8217;ve been using Unix-like systems, the more dependent I&#8217;ve become on the command-line. My current Window Maker configuration is a testimony to this. If you look at my Main Window Maker Workspace, you&#8217;ll notice that I actually use an Xterm instead of a desktop. Also, I don&#8217;t have a wallpaper. No wallpaper, no icons: I just want my prompt, in a nice font.</p>

<p>I despise graphical file managers. It feels like having to type without fingers. I&#8217;m not advocating the use of a command-line shell for new users or anything but for somebody like me who is used to calling programs &#8220;by hand&#8221;, a GUI is pure torture. With a GUI, I end up having to find a specialized program for a lot of mundane tasks which can be accomplished in Bash with a simple loop and a few filters. Renaming a few hundred files springs to mind.</p>

<div id="attachment_450" class="wp-caption alignright" style="width: 310px"><a title="My Main Window Maker Workspace" rel="lightbox" href="http://blog.bigsmoke.us/uploads/2009/03/windowmaker-workspace-1.png"><img src="http://blog.bigsmoke.us/uploads/2009/03/windowmaker-workspace-1-300x187.png" alt="My Main Window Maker Workspace" title="My Main Window Maker Workspace" width="300" height="187" class="size-medium wp-image-450" /></a><p class="wp-caption-text">My Main Window Maker Workspace</p></div>

<p>GNU Screen provides for <a href="http://blog.bigsmoke.us/2008/12/04/gnu-screen-window-captions-as-xterm-tabs">&#8220;tabs&#8221; in my XTerms</a> and some other features I&#8217;ve come to depend on. That&#8217;s why, upon login, my Main Workspace appears with <q><tt>xterm -e screen</tt></q> already started. The <kbd>Windows Key + T</kbd> fires up another XTerm with a fresh screen session. If I want to attach to a previous Screen session, I use <kbd>Window+Shift+T</kbd>. This starts an XTerm without Screen.</p>

<h2>Starting applications</h2>

<p>I don&#8217;t like the applications menu, but I&#8217;ve added a few applications to it anyway to be able to bind short keys to them (<kbd>Win+F</kbd> for Firefox and <kbd>Win+T</kbd> for XTerm). When I want to start any other application, I use the run dialog (bound to <kbd>Win+R</kbd>) or I execute the app from an XTerm window. I don&#8217;t usually start applications by clicking their App Icon.</p>

<p>File viewers (such as Mplayer, Gliv, Okular, xlview, and wordview) are always started from an XTerm or from Firefox, because that&#8217;s where all my file arguments originate. These apps don&#8217;t need App Icons, especially because I don&#8217;t see them as belonging to any particular workspace.</p>

<h2>All keyboard shortcuts</h2>

<p>Instead of Alt, I use the Window key (Mod4) a lot for my keyboard shortcuts.</p>

<pre class="bash">cat /home/bigsmoke/GNUstep/Defaults/WindowMaker |grep -i key|sed -e <span style="color: #ff0000;">'s/^<span style="color: #000099; font-weight: bold;">\s</span>*//'</span>|sort</pre>

<pre class="ini"><span style="color: #000099;">CloseKey </span>= <span style="color: #933;">&quot;Mod4+Q&quot;</span><span style="color: #666666; font-style: italic;">;</span>
<span style="color: #000099;">FocusNextKey </span>= <span style="color: #933;">&quot;Mod4+Tab&quot;</span><span style="color: #666666; font-style: italic;">;</span>
<span style="color: #000099;">FocusPrevKey </span>= <span style="color: #933;">&quot;Shift+Mod4+Tab&quot;</span><span style="color: #666666; font-style: italic;">;</span>
<span style="color: #000099;">HideKey </span>= <span style="color: #933;">&quot;Mod4+H&quot;</span><span style="color: #666666; font-style: italic;">;</span>
<span style="color: #000099;">HideOthersKey </span>= <span style="color: #933;">&quot;Shift+Mod4+H&quot;</span><span style="color: #666666; font-style: italic;">;</span>
<span style="color: #000099;">HMaximizeKey </span>=<span style="color: #660066;"> None</span><span style="color: #666666; font-style: italic;">;</span>
<span style="color: #000099;">LowerKey </span>= <span style="color: #933;">&quot;Mod4+Down&quot;</span><span style="color: #666666; font-style: italic;">;</span>
<span style="color: #000099;">MaximizeKey </span>= <span style="color: #933;">&quot;Mod4+M&quot;</span><span style="color: #666666; font-style: italic;">;</span>
<span style="color: #000099;">MiniaturizeKey </span>= <span style="color: #933;">&quot;Mod4+period&quot;</span><span style="color: #666666; font-style: italic;">;</span>
<span style="color: #000099;">ModifierKey </span>=<span style="color: #660066;"> Mod4</span><span style="color: #666666; font-style: italic;">;</span>
<span style="color: #000099;">MoveResizeKey </span>=<span style="color: #660066;"> None</span><span style="color: #666666; font-style: italic;">;</span>
<span style="color: #000099;">NextWorkspaceKey </span>= <span style="color: #933;">&quot;Shift+Mod4+Right&quot;</span><span style="color: #666666; font-style: italic;">;</span>
<span style="color: #000099;">PrevWorkspaceKey </span>= <span style="color: #933;">&quot;Shift+Mod4+Left&quot;</span><span style="color: #666666; font-style: italic;">;</span>
<span style="color: #000099;">RaiseKey </span>= <span style="color: #933;">&quot;Mod4+Up&quot;</span><span style="color: #666666; font-style: italic;">;</span>
<span style="color: #000099;">RootMenuKey </span>= <span style="color: #933;">&quot;Mod4+A&quot;</span><span style="color: #666666; font-style: italic;">;</span>
<span style="color: #000099;">ScreenSwitchKey </span>=<span style="color: #660066;"> None</span><span style="color: #666666; font-style: italic;">;</span>
<span style="color: #000099;">ShadeKey </span>= <span style="color: #933;">&quot;Mod4+minus&quot;</span><span style="color: #666666; font-style: italic;">;</span>
<span style="color: #000099;">ToggleKbdModeKey </span>=<span style="color: #660066;"> None</span><span style="color: #666666; font-style: italic;">;</span>
<span style="color: #000099;">WindowListKey </span>= <span style="color: #933;">&quot;Mod4+W&quot;</span><span style="color: #666666; font-style: italic;">;</span>
<span style="color: #000099;">WindowMenuKey </span>= <span style="color: #933;">&quot;Mod4+Escape&quot;</span><span style="color: #666666; font-style: italic;">;</span>
<span style="color: #000099;">WindowShortcut10Key </span>=<span style="color: #660066;"> None</span><span style="color: #666666; font-style: italic;">;</span>
<span style="color: #000099;">WindowShortcut1Key </span>= <span style="color: #933;">&quot;Mod4+1&quot;</span><span style="color: #666666; font-style: italic;">;</span>
<span style="color: #000099;">WindowShortcut2Key </span>= <span style="color: #933;">&quot;Mod4+2&quot;</span><span style="color: #666666; font-style: italic;">;</span>
<span style="color: #000099;">WindowShortcut3Key </span>= <span style="color: #933;">&quot;Mod4+3&quot;</span><span style="color: #666666; font-style: italic;">;</span>
<span style="color: #000099;">WindowShortcut4Key </span>= <span style="color: #933;">&quot;Mod4+4&quot;</span><span style="color: #666666; font-style: italic;">;</span>
<span style="color: #000099;">WindowShortcut5Key </span>= <span style="color: #933;">&quot;Mod4+5&quot;</span><span style="color: #666666; font-style: italic;">;</span>
<span style="color: #000099;">WindowShortcut6Key </span>= <span style="color: #933;">&quot;Mod4+6&quot;</span><span style="color: #666666; font-style: italic;">;</span>
<span style="color: #000099;">WindowShortcut7Key </span>=<span style="color: #660066;"> None</span><span style="color: #666666; font-style: italic;">;</span>
<span style="color: #000099;">WindowShortcut8Key </span>=<span style="color: #660066;"> None</span><span style="color: #666666; font-style: italic;">;</span>
<span style="color: #000099;">WindowShortcut9Key </span>=<span style="color: #660066;"> None</span><span style="color: #666666; font-style: italic;">;</span>
<span style="color: #000099;">Workspace10Key </span>=<span style="color: #660066;"> None</span><span style="color: #666666; font-style: italic;">;</span>
<span style="color: #000099;">Workspace1Key </span>= <span style="color: #933;">&quot;Mod4+F1&quot;</span><span style="color: #666666; font-style: italic;">;</span>
<span style="color: #000099;">Workspace2Key </span>= <span style="color: #933;">&quot;Mod4+F2&quot;</span><span style="color: #666666; font-style: italic;">;</span>
<span style="color: #000099;">Workspace3Key </span>= <span style="color: #933;">&quot;Mod4+F3&quot;</span><span style="color: #666666; font-style: italic;">;</span>
<span style="color: #000099;">Workspace4Key </span>= <span style="color: #933;">&quot;Mod4+F4&quot;</span><span style="color: #666666; font-style: italic;">;</span>
<span style="color: #000099;">Workspace5Key </span>= <span style="color: #933;">&quot;Mod4+F5&quot;</span><span style="color: #666666; font-style: italic;">;</span>
<span style="color: #000099;">Workspace6Key </span>= <span style="color: #933;">&quot;Mod4+F6&quot;</span><span style="color: #666666; font-style: italic;">;</span>
<span style="color: #000099;">Workspace7Key </span>= <span style="color: #933;">&quot;Mod4+F7&quot;</span><span style="color: #666666; font-style: italic;">;</span>
<span style="color: #000099;">Workspace8Key </span>= <span style="color: #933;">&quot;Mod4+F8&quot;</span><span style="color: #666666; font-style: italic;">;</span>
<span style="color: #000099;">Workspace9Key </span>=<span style="color: #660066;"> None</span><span style="color: #666666; font-style: italic;">; </span></pre>

<p>One annoyance is that, when switching through the Windows in the current Workspace (in my case, with <kbd>Win+Tab</kbd> and <kbd>Win+Shift+Tab</kbd>), doesn&#8217;t disappear unless an additional key press is given (such as an extra <kbd>Tab</kbd>).</p>

<p>Another annoyance is in my configuration. My keyboard has some space after every 4 function keys. Also, like always, the function keys are a bit far removed from the home row on the keyboard. So, I should consider switching through workspaces with <kbd>Win+1</kbd> through <kbd>Win+7</kbd> instead of <kbd>Win+F1</kbd> through <kbd>Win+F7</kbd>. I&#8217;ve now bound the <kbd>Win+&lt;number&gt;</kbd> keys to a Window 1 to 10, but this seems to be terribly broken anyway in Window Maker (I can only switch to the first window in the first workspace this way). Also, I probably wouldn&#8217;t use it even if it did work, unless if they displayed the window numbers on the app icons or something and if they did the numbering on a workspace basis instead of globally. So, I&#8217;m probably going to change this soon.</p>

<div id="attachment_451" class="wp-caption alignright" style="width: 310px"><a title="My Window Maker Workspace for Audio" rel="lightbox" href="http://blog.bigsmoke.us/uploads/2009/03/wmaker-workspace-2.png"><img src="http://blog.bigsmoke.us/uploads/2009/03/wmaker-workspace-2-300x187.png" alt="My Window Maker Workspace for Audio" title="My Window Maker Workspace for Audio" width="300" height="187" class="size-medium wp-image-451" /></a><p class="wp-caption-text">My Window Maker Workspace for Audio</p></div>

<h2>Workspaces</h2>

<p>One of the things I&#8217;ve always like about X Window Managers is the support for multiple virtual desktops, called Workspaces in Window Maker. I use topical workspaces, one workspace per application category. It&#8217;s possible to configure app icons to always start the application in the correct workspace regardless of where it is started from. My Workspaces are called Main, Audio, Video, Down, w3dev and Image.</p>

<p>If I want to look at my downloads, I know that I just have to switch to Workspace 4 (Down) regardless of what I&#8217;m downloading. The same goes when I want to switch a song (be it in Mplayer (in an XTerm) or in the Last.fm Player): I press <kbd>Win+F2</kbd>.</p>

<p>Here&#8217;s a list of all the app icons divided over my different workspaces:</p>

<ol>
<li>Main: Window Maker Preferences, Google Earth, Skype, Filelight</li>
<li>Audio: Rosegarden, Audacity, Hydrogen, Last.fm, Grip, Ardour, ReZound, Gnaural</li>
<li>Video: Cinelerra</li>
<li>Down: BitTorrent, uTorrent, Transmission</li>
<li>w3dev: MSIE, Konqueror</li>
<li>Image: Krita, Inkscape, GIMP, Color Schemer Studio</li>
</ol>

<p>I have a widescreen laptop, so I display all these per-workspace icons (with the <em>Clip</em>) vertically at the top left. At the bottom left I display the &#8220;Icon List&#8221;. This is used by WindowMaker for icons that are not already in the Clip or in the Dock.</p>

<p>At the right I display the dock with the XTerm icon and the Firefox icon. There&#8217;s also an Emacs icon there from the time that I wanted to learn Emacs. (Sadly, I know VIM too well to change.)</p>

<p>Below that, also at the right, are the Dock Apps: <a href="http://vlad.minisat.ro/~vlad2/dockapps/">wmsystray</a>, <a href="http://dockapps.org/file.php/id/222">WMWiFi</a>, <a href="http://gentoo-portage.com/x11-plugins/wmmixer">wmmixer</a>, <a href="http://dockapps.org/file.php/id/22">WMitime</a>, <a href="http://kitenet.net/~joey/code/wmbattery/">wmbattery</a>, and of course <a href="http://dockapps.org/file.php/id/14">wmMoonClock</a>.</p>

<h2>Why Window Maker</h2>

<p>With all this reluctance to click on icons, you&#8217;d wonder if I wouldn&#8217;t be better of trying something more keyboard centric such as <a href="http://www.nongnu.org/stumpwm/">StumpWM</a> (the successor of Ratpoison).</p>

<p>If I will, I&#8217;ll let you know.</p>]]></content:encoded>
			<wfw:commentRss>http://blog.bigsmoke.us/2009/03/30/wmaker/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>GNU Screen window captions as XTerm tabs</title>
		<link>http://blog.bigsmoke.us/2008/12/04/gnu-screen-window-captions-as-xterm-tabs</link>
		<comments>http://blog.bigsmoke.us/2008/12/04/gnu-screen-window-captions-as-xterm-tabs#comments</comments>
		<pubDate>Thu, 04 Dec 2008 20:17:41 +0000</pubDate>
		<dc:creator>Rowan Rodrik</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[CLI]]></category>
		<category><![CDATA[GNU]]></category>
		<category><![CDATA[Screen]]></category>
		<category><![CDATA[XTerm]]></category>

		<guid isPermaLink="false">http://blog.bigsmoke.us/?p=202</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p>XTerm is my <a href="http://blog.bigsmoke.us/2008/11/27/xterm-is-favorite">favorite terminal emulator</a> and I love GNU Screen. So, imagine my joy when I found out that Screen can persistently show window captions (<q><kbd>[Ctrl+A]: caption always</kbd></q>).</p>

<p><img src="http://blog.bigsmoke.us/wp-factory/../uploads/2008/12/screen-with-default-window-captions-in-xterm.png" alt="GNU Sreen with default window captions (in XTerm)" title="GNU Sreen with default window captions (in XTerm)" class="size-full wp-image-205" /></p>

<p>Now I wouldn&#8217;t loose track of my windows so easily. No more detours through the Window-list, and it gets better; from the Screen manual, I learned that I could set the caption to a string. Look what <q><kbd>[Ctrl+A]: caption '%w'</kbd></q> does:</p>

<p><img src="http://blog.bigsmoke.us/wp-factory/../uploads/2008/12/screen-with-simple-window-captions-in-xterm.png" alt="GNU Screen with simple window captions (in XTerm)" title="GNU Screen with simple window captions in XTerm" class="size-full wp-image-204" /></p>

<p>Cool! I could finally have my XTerm tabs. <img src='http://blog.bigsmoke.us/wp-factory/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  Just recently, I was telling <a href="/author/halfgaar">Wiebe</a>&#8212;in reply to a complaint of him about getting lost in Screen&#8217;s window list&#8212;how cool it would be if you could have a terminal emulator display a tab for each screen window. Now I can tell him, instead, that tabs in a terminal emulator are a superfluous feature.</p>

<h2>My current configuration</h2>

<p><img src="http://blog.bigsmoke.us/uploads/2008/12/screen-with-window-captions-in-xterm.png" alt="GNU Screen with window captions (in XTerm)" title="GNU Screen with window captions (in XTerm)" class="size-full wp-image-203" /></p>

<p>This last example is done with the following Screen command: <q><kbd>caption always "%{= kB}%-Lw%{=s kB}%50>%n%f* %t %{-}%+Lw%<"</kbd></q> There are more examples in the manual page. Enjoy your tabs!</p>]]></content:encoded>
			<wfw:commentRss>http://blog.bigsmoke.us/2008/12/04/gnu-screen-window-captions-as-xterm-tabs/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>XTerm is favorite</title>
		<link>http://blog.bigsmoke.us/2008/11/27/xterm-is-favorite</link>
		<comments>http://blog.bigsmoke.us/2008/11/27/xterm-is-favorite#comments</comments>
		<pubDate>Thu, 27 Nov 2008 21:43:42 +0000</pubDate>
		<dc:creator>Rowan Rodrik</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[CLI]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[X]]></category>
		<category><![CDATA[xrdb]]></category>
		<category><![CDATA[XTerm]]></category>

		<guid isPermaLink="false">http://blog.bigsmoke.us/?p=108</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p>XTerm is know to most X-Windows users as that ugly terminal with the strange scrollbar and the unreadable font. And it doesn&#8217;t even have tabs! But, I think it&#8217;s the best damn terminal emulator in the world. It just doesn&#8217;t appear that way at first.</p> 

<p>By default, XTerm comes with warts:</p>

<ul>
  <li>It has an ugly, small font.</li>
  <li>What&#8217;s up with the black on white? I&#8217;m a 1337 h4x0r and I want a black background, damnit!</li>
  <li>Double-click Selections is unintuitive.</li>
  <li>Where are the tabs?</li>
</ul>

<p><img src="http://blog.bigsmoke.us/wp-factory/../uploads/2008/11/bare-xterm.png" alt="Default configuration for XTerm 234" title="Default configuration for XTerm 234" width="484" height="165" class="size-full wp-image-192" /></p>

<p>But its warts are easily removed.</p>

<h2>The font is small and ugly</h2>

<p>Easily solved:</p>

<pre>
$ xrdb -merge
/* I want pretier fonts */
XTerm*faceName: Liberation Mono
XTerm*faceSize: 10
[Ctrl+D]
$ xterm
</pre>

<p><img src="http://blog.bigsmoke.us/wp-factory/../uploads/2008/11/xterm-with-nicer-fonts.png" alt="XTerm with nicer than default font" title="XTerm with nicer than default font" width="724" height="215" class="size-full wp-image-191" /></p>

<h2>The black on white is an insult to my 1337ness</h2>

<p>No longer so:</p>

<pre>
$ xrdb -merge
/* I want a 1337-style color-scheme */
XTerm*background: black
XTerm*Foreground: Grey
[Ctrl+D]
$ xterm
</pre>

<p>Now I can install my 1337 hacking tools in style! (If only I could install 1337 hacking skills as easily.)</p>

<p><img src="http://blog.bigsmoke.us/wp-factory/../uploads/2008/11/1337-style-xterm.png" alt="1337-style XTerm" title="1337-style XTerm" width="724" height="215" class="size-full wp-image-193" /></p>

<h2>Double-click selections are unintuitive</h2>

<p>Most terminal emulators let you double-click to quickly select words. XTerm does this as well, but its definition of a &#8220;word&#8221; is a bit narrow if you&#8217;re used to other programs. The good news is that XTerm is <strong>extremely configurable</strong> in this sense. It lets you decide what to select on double-click, on triple-click, all the way up to 5 clicks. You can define the boundaries of the selection by means of presets such as <q>line</q>, <q>group</q> and <q>page</q>, but what I like best is its ability to use regular expressions. This lets you do cool things, like, for example, using one click to select a word, two clicks to select a sentence, and three clicks to select a paragraph.</p>

<p>My own configuration is a bit simple, probably a testimony to how little code I write these days:</p>

<pre>$ xrdb -merge
/* The selection only stops at spaces and newlines */
XTerm*on2Clicks: regex [^  \n]+
[Ctrl+D]
</pre>

<h2>Where are my tabs</h2>

<p>You should really be using <a href="http://en.wikipedia.org/wiki/GNU_Screen">GNU Screen</a> instead, which has too many advantages to name here. It even allows you to do <a href="http://blog.bigsmoke.us/2008/07/23/pair-programming-through-gnu-screen">Remote pair programming</a> over SSH.</p>

<p>If you use Screen within an XTerm, be sure to add to following to your X configuration.</p>

<pre>$ echo "XTerm*metaSendsEscape: true" | xrdb -merge</pre>

<p>Otherwise, you might find yourself unable to control Screen

<h2>Saving your configuration</h2>

<p>Ready to save your precious configuration?</p>

<pre>
$ xrdb -edit .Xdefaults
</pre>

<p>You&#8217;re done. It&#8217;s time to go brag to your friends.</p>]]></content:encoded>
			<wfw:commentRss>http://blog.bigsmoke.us/2008/11/27/xterm-is-favorite/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Remote pair programming with GNU Screen</title>
		<link>http://blog.bigsmoke.us/2008/07/23/pair-programming-through-gnu-screen</link>
		<comments>http://blog.bigsmoke.us/2008/07/23/pair-programming-through-gnu-screen#comments</comments>
		<pubDate>Wed, 23 Jul 2008 16:09:08 +0000</pubDate>
		<dc:creator>Rowan Rodrik</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Extreme Programming]]></category>
		<category><![CDATA[pair programming]]></category>
		<category><![CDATA[Screen]]></category>
		<category><![CDATA[SSH]]></category>
		<category><![CDATA[XTerm]]></category>

		<guid isPermaLink="false">http://blog.bigsmoke.us/?p=101</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p>I like pair programming. So much, in fact, that I want to do it even if I can&#8217;t look over the other person&#8217;s shoulder due to some geographical offset. Since I&#8217;m a real command-line freak, I can get what I want easily by using GNU Screen.</p>

<h2>GNU Screen rehash</h2>

<p>If you don&#8217;t know GNU screen yet and you ever find yourself using the command-line for an extended period of time, learn it. Now. I&#8217;ll name just a few advantages:</p>

<ol>
  <li>You can manage multiple &#8220;windows&#8221; conveniently even if you don&#8217;t have a tabbed terminal emulator, or even when you&#8217;re not within a graphic environment such as X.</li>
  <li>You can &#8220;detach&#8221; and &#8220;reattach&#8221; your Screen sessions and continue exactly where you left. This is very useful if you do your work on a remote server, through SSH, for example. Never by stumped by instable connections again!</li>
  <li>But, the feature which is most useful for pair programming is the ability to attach to the same session from multiple terminals.</li>
</ol>

<p>Starting GNU Screen is very easy. Just type <q><kbd>screen</kbd></q> at your shell prompt (or <q><kbd>screen -S SESSION_NAME</kbd></q> if you want your session to have an easy-to-remember name).</p>

<p>Press <kbd>CTRL+A</kbd> followed by <kbd>d</kbd> to detach. Exit your terminal. Start a new terminal, type <q><kbd>screen -r</kbd></q> and be amazed that you have your session back. <q><kbd>screen -r</kbd></q> can take as an argument the name or <abbr title="Process ID">PID</abbr> of the screen, which is useful if you have more than one screen running. To get a list of current screen sessions, type <q><kbd>screen -ls</kbd></q>.</p>

<h2>Inviting your observer</h2>

<p>The first thing you have to do is to add the following command to your <tt>.screenrc</tt> file:</p>

<pre>multiuser on</pre>

<p>If you don&#8217;t want to enable multiuser by default, you can also choose to type the command from within Screen each time that you need it. This is done by pressing <kbd>Ctrl+A</kbd>, followed by <kbd>:</kbd> and the command.</p>

<p>Myself, I prefer to have the command in my <tt>.screenrc</tt>. You need to admit users explicitly anyway. Admitting full access to a user is done by typing the <q><kbd>:acladd USERNAME</kbd></q> command (after pressing <kbd>Ctrl+A</kbd>). Then the given user can join this session by starting screen with <q><kbd>screen -x SESSION_OWNER/</kbd></q> where <tt>SESSION_OWNER</tt> is the driver.</p>

<h2>Get out of my driver&#8217;s seat! (Dealing with annoying observers)</h2>

<p>The <q><kbd>:acladd USERNAME</kbd></q> command will give the observer full read-write access. Maybe, if you have to deal with an observer who insists on taking the driver seat, you want to limit his or her access to read-only. This can be done just as easily: press <kbd>Ctrl+A</kbd>; then type <q><kbd>:aclchg USERNAME -w "#"</kbd></q>.

<h2>Make your terminals match</h2>

<p>Using a shared screen, it can be kind of annoying if your terminal sizes don&#8217;t match. As an observer, I fix this by asking the driver to tell me the values of the <tt>$ROWS</tt> and <tt>$COLS</tt> environment variables. If then, for example <tt>$COLS=110</tt> and <tt>$ROWS=40</tt>, I start my xterm with this in mind: <q><kbd>xterm -geometry 110x40</kbd></q></p>

<h2>Have fun with Screen!</h2>

<p>I&#8217;ve only touched upon some of the things you can do with screen. The manual page contains much more information&#8212;perhaps a bit too much even. <img src='http://blog.bigsmoke.us/wp-factory/wp-includes/images/smilies/icon_confused.gif' alt=':-?' class='wp-smiley' /> </p>

<p>One of the things I also like to do with a shared screen session is remote system administration. If I want to perform delicate tasks as root, I find it kind of comforting if someone can stop me in time, before I do anything stupid. Besides, if you&#8217;re both root, you don&#8217;t even have to set permissions. <img src='http://blog.bigsmoke.us/wp-factory/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  So, it&#8217;s easy to.</p>]]></content:encoded>
			<wfw:commentRss>http://blog.bigsmoke.us/2008/07/23/pair-programming-through-gnu-screen/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

