{"id":1208,"date":"2013-05-17T13:02:29","date_gmt":"2013-05-17T12:02:29","guid":{"rendered":"http:\/\/www.stenyak.com\/?p=1208"},"modified":"2013-05-17T13:02:29","modified_gmt":"2013-05-17T12:02:29","slug":"trick-of-the-day-rendering-graphics-in-your-terminal","status":"publish","type":"post","link":"https:\/\/www.stenyak.com\/?p=1208","title":{"rendered":"Trick of the day: rendering graphics in your terminal"},"content":{"rendered":"<blockquote><p><em>&#8220;Those who cannot remember the past are condemned to repeat it&#8221;<\/em><\/p>\n<p style=\"text-align: right;\">&#8212;\u00a0Jorge Agust\u00edn Nicol\u00e1s Ruiz de Santayana y Borr\u00e1s<\/p>\n<\/blockquote>\n<p style=\"text-align: left;\"><a href=\"https:\/\/github.com\/breuleux\/terminus\"><img loading=\"lazy\" class=\"wp-image-1200 alignright\" style=\"border: 4px solid black; margin: 4px;\" alt=\"limecat\" src=\"http:\/\/www.stenyak.com\/wp-content\/uploads\/2013\/05\/limecat.png\" width=\"388\" height=\"273\" \/><\/a><\/p>\n<p>Over the past few years, a number of &#8220;graphic terminal&#8221; emulator software have emerged. Some examples:<\/p>\n<ul>\n<li><a href=\"https:\/\/github.com\/breuleux\/terminus\">terminus<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/mitotic\/graphterm\">graphterm<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/hoeck\/schirm\">schirm<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/new299\/hackterm\">hackterm<\/a><\/li>\n<\/ul>\n<p>This is nothing new, in fact <strong>it was possible back in the 70&#8217;s<\/strong>, and you can try it using <strong>XTerm<\/strong>, the default terminal emulator bundled with X installations since forever!<\/p>\n<p>The process is very simple, you simply have to run:<\/p>\n<pre style=\"text-align: left;\">$ xterm -t -tn tek4014<\/pre>\n<p>Which will start an xterm emulating a\u00a0<a href=\"http:\/\/en.wikipedia.org\/wiki\/Tektronix_4010\">TEK4014<\/a>\u00a0terminal (instead of the default VTxxx plain-text terminal).<\/p>\n<div id=\"attachment_1204\" style=\"width: 210px\" class=\"wp-caption alignleft\"><a href=\"http:\/\/en.wikipedia.org\/wiki\/Tektronix_4010\"><img aria-describedby=\"caption-attachment-1204\" loading=\"lazy\" class=\"size-full wp-image-1204  \" style=\"border: 4px solid black; margin: 4px;\" title=\"TEK4010 terminal\" alt=\"Tektronix_4014\" src=\"http:\/\/www.stenyak.com\/wp-content\/uploads\/2013\/05\/Tektronix_4014.jpg\" width=\"200\" height=\"264\" \/><\/a><p id=\"caption-attachment-1204\" class=\"wp-caption-text\">TEK4010 terminal<\/p><\/div>\n<p>Now we&#8217;ll download some images we want to display. These 40 year old terminals don&#8217;t support JPEG though (it didn&#8217;t exist back then), nor any popular modern image format, so we&#8217;ll have to provide images in a format they understand. Plotutils includes a couple of these <strong>vectorial images<\/strong>, so we will run:<\/p>\n<pre style=\"text-align: left;\"># apt-get install plotutils<\/pre>\n<p>And finally it&#8217;s simply a matter of feeding the Tek4014 terminal with an image, for example:<\/p>\n<pre style=\"text-align: left;\">$ zcat \/usr\/share\/doc\/plotutils\/tek2plot\/dmerc.tek.gz<\/pre>\n<p>The terminal will \u00a0be fed with an appropriate escape character sequence, along with the actual image contents, it&#8217;ll interpret it as an image (just like <a href=\"http:\/\/en.wikipedia.org\/wiki\/ANSI_escape_sequences\">other escape sequences<\/a> are interpreted as colored or underlined text), and the awesome result will be this:<\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: center;\"><a href=\"http:\/\/www.stenyak.com\/wp-content\/uploads\/2013\/05\/xterm.gif\"><img loading=\"lazy\" class=\"size-full wp-image-1209 aligncenter\" style=\"margin-top: 4px; margin-bottom: 4px;\" alt=\"xterm\" src=\"http:\/\/www.stenyak.com\/wp-content\/uploads\/2013\/05\/xterm.gif\" width=\"754\" height=\"592\" \/><\/a><\/p>\n<p style=\"text-align: left;\">How cool is that? \ud83d\ude42<\/p>\n<p>&nbsp;<\/p>\n<p>You can even <strong>resize the terminal<\/strong> window, and the graphics will be re-rendered with the correct size (remember it&#8217;s a vectorial image, so wen can zoom in indefinitely).<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&#8220;Those who cannot remember the past are condemned to repeat it&#8221; &#8212;\u00a0Jorge Agust\u00edn Nicol\u00e1s Ruiz de Santayana y Borr\u00e1s Over the past few years, a number of &#8220;graphic terminal&#8221; emulator software have emerged. Some examples: terminus graphterm schirm hackterm This is nothing new, in fact it was possible back in the 70&#8217;s, and you can [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[3],"tags":[13],"_links":{"self":[{"href":"https:\/\/www.stenyak.com\/index.php?rest_route=\/wp\/v2\/posts\/1208"}],"collection":[{"href":"https:\/\/www.stenyak.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.stenyak.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.stenyak.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.stenyak.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1208"}],"version-history":[{"count":0,"href":"https:\/\/www.stenyak.com\/index.php?rest_route=\/wp\/v2\/posts\/1208\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.stenyak.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1208"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.stenyak.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1208"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.stenyak.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1208"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}