<?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>Random and Irrelevant &#187; Solaris</title>
	<atom:link href="http://sgp.me.uk/tag/solaris/feed/" rel="self" type="application/rss+xml" />
	<link>http://sgp.me.uk</link>
	<description>Sam Pearson&#039;s weblog - irrelevant content randomly updated</description>
	<lastBuildDate>Fri, 18 Nov 2011 18:06:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Solaris and Linux xterm terminfo differences</title>
		<link>http://sgp.me.uk/2009/01/06/solaris-and-linux-xterm-terminfo-differences/</link>
		<comments>http://sgp.me.uk/2009/01/06/solaris-and-linux-xterm-terminfo-differences/#comments</comments>
		<pubDate>Tue, 06 Jan 2009 20:35:11 +0000</pubDate>
		<dc:creator>Sam</dc:creator>
				<category><![CDATA[Geekery]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Solaris]]></category>
		<category><![CDATA[terminfo]]></category>

		<guid isPermaLink="false">http://sgp.me.uk/?p=487</guid>
		<description><![CDATA[This problem might well be well-known to hardcore UNIX people but it had me scratching me head for a bit today so I thought I'd post about it together with my workaround. <a href="http://sgp.me.uk/2009/01/06/solaris-and-linux-xterm-terminfo-differences/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>This problem might well be well-known to hardcore UNIX people but it had me scratching me head for a bit today so I thought I&#8217;d post about it together with my workaround.</p>
<p>I sometimes have cause to use a terminal-based application installed on servers running Solaris 9 that uses function keys <code>F1</code> &#8211; <code>F4</code> to navigate its internal menus. In the past I&#8217;ve accessed these from a Windows XP laptop using <a href="http://www.chiark.greenend.org.uk/~sgtatham/putty/">Putty</a>, but recently I&#8217;ve started using a Linux machine running Xubuntu. Today I came to try and use this particular application from the Linux box but (leaving aside the fact that the <code>F1</code> key is reserved for the Help system in Xubuntu&#8217;s terminal app) the function keys merely echoed back <code>0Q</code>, <code>0R</code> and <code>0S</code> rather than performing the desired menu operations.</p>
<p>This made me think it was a <a href="http://en.wikipedia.org/wiki/Terminfo">terminfo</a> related problem and a bit of <a href="http://www.google.co.uk/search?q=xterm+terminfo+linux+solaris">Googling</a> confirmed that this was most likely the root cause. I did some comparisons of the output of <code>infocmp</code> on both systems and it turns out that the terminfo definition for <code>xterm</code> used on Solaris 9 differs considerably from that on Linux in a number of ways. Specific to my problem, the sequences defined for <code>F1</code> &#8211; <code>F4</code> on Solaris 9 are different from those on Linux as follows:</p>
<table border="0">
<tbody>
<tr>
<th>Key</th>
<th>Solaris 9</th>
<th>Linux</th>
</tr>
<tr>
<td><code>F1</code></td>
<td><code>\E[11~</code></td>
<td><code>\E0P</code></td>
</tr>
<tr>
<td><code>F2</code></td>
<td><code>\E[12~</code></td>
<td><code>\E0Q</code></td>
</tr>
<tr>
<td><code>F3</code></td>
<td><code>\E[13~</code></td>
<td><code>\E0R</code></td>
</tr>
<tr>
<td><code>F4</code></td>
<td><code>\E[14~</code></td>
<td><code>\E0S</code></td>
</tr>
</tbody>
</table>
<p>I could see three obvious ways of dealing with this problem.</p>
<ol>
<li>Distribute an updated <code>xterm</code> terminfo definition to one set of machines.</li>
<li>Create a custom terminfo definition, distribute it to all the machines and use it when ssh&#8217;ing between them.</li>
<li>Locate an exisiting terminfo definition already shared by the machines that meets the immediate requirements.</li>
</ol>
<p>The disadvantages of (1) include possibly breaking other things that rely on the exisiting definitions and also the fact that system policy might prevent changing this kind of setting to meet an individual&#8217;s requirement. (2) Might be a bit more promising but it means spending the time creating the definition and also assumes no issues with system policy as implied above. (3) is the path of least resisitance.</p>
<p>In fact (3) is the solution I currently use. The <code>vt220</code> definitions are similar enough and match on the all-important function key definitions, so I&#8217;m currently setting <code>$TERM</code> to this value before ssh&#8217;ing from my Linux box to the Solaris servers.</p>
]]></content:encoded>
			<wfw:commentRss>http://sgp.me.uk/2009/01/06/solaris-and-linux-xterm-terminfo-differences/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

