{"id":5992,"date":"2014-03-02T11:33:09","date_gmt":"2014-03-02T16:33:09","guid":{"rendered":"http:\/\/g33kinfo.com\/info\/?p=5992"},"modified":"2014-03-02T11:33:09","modified_gmt":"2014-03-02T16:33:09","slug":"butterfly","status":"publish","type":"post","link":"https:\/\/g33kinfo.com\/info\/butterfly\/","title":{"rendered":"butterfly"},"content":{"rendered":"<p>&nbsp;<br \/>\nFrom <a href=\"http:\/\/paradoxxxzero.github.io\/2014\/02\/28\/butterfly.html\" target=\"_blank\" rel=\"noopener noreferrer\">paradoxxxzero.github.io<\/a><br \/>\n&nbsp;<\/p>\n<section class=\"container\">\n<header class=\"page-header\">\n<h2>butterfly: your everyday terminal right in your web browser<\/h2>\n<\/header>\n<article class=\"post butterfly\">There&#8217;s something I&#8217;ve been working on recently, at start just for fun but it turned out I use it everyday, so here it is:<br \/>\n<!--more--><br \/>\n<img decoding=\"async\" alt=\"butterfly screen cast\" src=\"http:\/\/paradoxxxzero.github.io\/assets\/butterfly_1.gif\" \/><br \/>\n&nbsp;<\/p>\n<h2>Try it<\/h2>\n<p>To try it, it&#8217;s as simple as:<\/p>\n<div class=\"highlight\">\n<code>sudo pip install butterfly  #Install butterfly<br \/>\nbutterfly.server.py         # Launch the web server<\/code>\n<\/div>\n<p>Then all you have to do is go to : <a href=\"http:\/\/localhost:57575\">localhost:57575<\/a><\/p>\n<h2>Use it<\/h2>\n<h3>Server side<\/h3>\n<h4>Run at start-up with systemd<\/h4>\n<p>As it relies on a server running in background, you can download the systemd file from here <a href=\"https:\/\/github.com\/paradoxxxzero\/butterfly\/raw\/master\/butterfly.service\">butterfly.service<\/a> put it in <code>\/etc\/systemd\/system\/<\/code> or equivalent and:<\/p>\n<div class=\"highlight\">\n<code>sudo systemctl enable butterfly<br \/>\nsudo systemctl start butterfly<\/code><\/p>\n<\/div>\n<p>Now the server will always be running.<\/p>\n<h4>Running as root and multiple users<\/h4>\n<p>butterfly is made to work as the terminal user and as root. When running as root the privileges are dropped to the user that initiated the connection, i.e. the user that opened the web page. You can change the terminal user by going to <a href=\"http:\/\/localhost:57575\/user\/user\">localhost:57575\/user\/&lt;user&gt;<\/a>.<\/p>\n<h4>Access from a remote machine<\/h4>\n<p>You can set the bind host with <code>butterfly.server.py --host=\"0.0.0.0\"<\/code> which will allow other users to connect to your terminal. A password will be asked but IT IS NOT SECURE! So it&#8217;s recommended as of now to run this only on local network for testing purposes.<\/p>\n<h4>Run a specific shell<\/h4>\n<p>Use the <strong>shell<\/strong> command line option: <code>butterfly.server.py --shell=\/bin\/fish<\/code><\/p>\n<h3>Client side<\/h3>\n<p>butterfly works like any other terminal but it has some specific features.<\/p>\n<h4>Enter browser shortcuts<\/h4>\n<p>When the terminal is focused all the hot-keys are caught (except from those the browser prevent to catch). If you want to access the address bar with <strong>CTRL + L<\/strong> it won&#8217;t work. That why the <strong>ALT + Z<\/strong> combination is here to tell butterfly that the next key combination must not be caught. In other word accessing the address bar is done by doing <strong>ALT + Z<\/strong> then <strong>CTRL + L<\/strong>. (If your browser support css3 filters the screen will turn sepia).<\/p>\n<h4>Quick selection of history text<\/h4>\n<p>This is a feature I&#8217;ve always wanted to find in a terminal, quick history selection. I&#8217;ve started to implement some ideas you can try by hitting <strong>CTRL + SHIFT + up<\/strong> and then navigating the selection with <strong>CTRL + SHIFT + up\/down<\/strong> and the arrow keys. When you got it right, hit <strong>ENTER<\/strong> and butterfly will enter the selection right into the prompt:<\/p>\n<p><img decoding=\"async\" alt=\"butterfly selection\" src=\"http:\/\/paradoxxxzero.github.io\/assets\/butterfly_2.gif\" \/><\/p>\n<h2>Other features<\/h2>\n<ul>\n<li>The visual style is done using css so it&#8217;s entirely editable.<\/li>\n<li>You can easily extend the in-browser terminal behavior by writing javascript (like it&#8217;s done for the quick selection).<\/li>\n<li>As apparently it&#8217;s trendy to use a &#8220;modern&#8221; text editor based on a browser, so&#8230;<\/li>\n<\/ul>\n<p><img decoding=\"async\" alt=\"butterfly modern editors\" src=\"http:\/\/paradoxxxzero.github.io\/assets\/butterfly_3.gif\" \/><\/p>\n<h2>Missing features<\/h2>\n<ul>\n<li>The scroll-back is actually limited to 100 000 lines as of now in order to limit the memory footprint. It would be a good idea to store the scroll-back on the disk using the server.<\/li>\n<li>Embedding html directly into the terminal is possible and partially supported with the <code>ESC]99;&lt;html&gt;BELL<\/code> command. It can lead to some <a href=\"https:\/\/github.com\/paradoxxxzero\/butterfly\/tree\/master\/bin\">interesting features<\/a>.<\/li>\n<li>16.7 millions of color is not yet supported but it&#8217;s one hack away using the <code>ESC[38;2;r;g;bm<\/code> escape.<\/li>\n<li>An in-terminal css\/js editing options with why not a package repository for theme and extensions.<\/li>\n<\/ul>\n<h2>That&#8217;s all<\/h2>\n<p><a href=\"https:\/\/github.com\/paradoxxxzero\/butterfly\">The repository is hosted on github<\/a>.<\/p>\n<p>So let me know what do you think of it, I had a lot of fun writing it anyway.<br \/>\nFrom <a href=\"http:\/\/paradoxxxzero.github.io\/2014\/02\/28\/butterfly.html\" target=\"_blank\" rel=\"noopener noreferrer\">paradoxxxzero.github.io<\/a><br \/>\n<\/article>\n<footer class=\"disqus\"><\/footer>\n<\/section>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp; From paradoxxxzero.github.io &nbsp; butterfly: your everyday terminal right in your web browser There&#8217;s something I&#8217;ve been working on recently, at start just for fun but it turned out I use it everyday, so here it is:&#8230; <\/p>\n<div class=\"read-more navbutton\"><a href=\"https:\/\/g33kinfo.com\/info\/butterfly\/\">Read More<i class=\"fa fa-angle-double-right\"><\/i><\/a><\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[],"class_list":["post-5992","post","type-post","status-publish","format-standard","hentry","category-info"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.0 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>butterfly - Linux Shtuff<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/g33kinfo.com\/info\/butterfly\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"butterfly - Linux Shtuff\" \/>\n<meta property=\"og:description\" content=\"&nbsp; From paradoxxxzero.github.io &nbsp; butterfly: your everyday terminal right in your web browser There&#8217;s something I&#8217;ve been working on recently, at start just for fun but it turned out I use it everyday, so here it is:... Read More\" \/>\n<meta property=\"og:url\" content=\"https:\/\/g33kinfo.com\/info\/butterfly\/\" \/>\n<meta property=\"og:site_name\" content=\"Linux Shtuff\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/fb.me\/g33kinf0\" \/>\n<meta property=\"article:author\" content=\"https:\/\/fb.me\/g33kinf0\" \/>\n<meta property=\"article:published_time\" content=\"2014-03-02T16:33:09+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/paradoxxxzero.github.io\/assets\/butterfly_1.gif\" \/>\n<meta name=\"author\" content=\"g33kadmin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/twitter.com\/drsinger1111\" \/>\n<meta name=\"twitter:site\" content=\"@drsinger1111\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/butterfly\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/butterfly\\\/\"},\"author\":{\"name\":\"g33kadmin\",\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/#\\\/schema\\\/person\\\/c022e4c40b13ea1b678e6f020756f547\"},\"headline\":\"butterfly\",\"datePublished\":\"2014-03-02T16:33:09+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/butterfly\\\/\"},\"wordCount\":554,\"publisher\":{\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/#\\\/schema\\\/person\\\/c022e4c40b13ea1b678e6f020756f547\"},\"image\":{\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/butterfly\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/paradoxxxzero.github.io\\\/assets\\\/butterfly_1.gif\",\"articleSection\":[\"General Info\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/butterfly\\\/\",\"url\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/butterfly\\\/\",\"name\":\"butterfly - Linux Shtuff\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/butterfly\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/butterfly\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/paradoxxxzero.github.io\\\/assets\\\/butterfly_1.gif\",\"datePublished\":\"2014-03-02T16:33:09+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/butterfly\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/g33kinfo.com\\\/info\\\/butterfly\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/butterfly\\\/#primaryimage\",\"url\":\"http:\\\/\\\/paradoxxxzero.github.io\\\/assets\\\/butterfly_1.gif\",\"contentUrl\":\"http:\\\/\\\/paradoxxxzero.github.io\\\/assets\\\/butterfly_1.gif\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/butterfly\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"butterfly\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/#website\",\"url\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/\",\"name\":\"Linux Shtuff\",\"description\":\"Because I have CRS Syndrome...\",\"publisher\":{\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/#\\\/schema\\\/person\\\/c022e4c40b13ea1b678e6f020756f547\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/#\\\/schema\\\/person\\\/c022e4c40b13ea1b678e6f020756f547\",\"name\":\"g33kadmin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/wp-content\\\/uploads\\\/2022\\\/07\\\/minion-researchA.gif\",\"url\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/wp-content\\\/uploads\\\/2022\\\/07\\\/minion-researchA.gif\",\"contentUrl\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/wp-content\\\/uploads\\\/2022\\\/07\\\/minion-researchA.gif\",\"width\":512,\"height\":512,\"caption\":\"g33kadmin\"},\"logo\":{\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/wp-content\\\/uploads\\\/2022\\\/07\\\/minion-researchA.gif\"},\"description\":\"I am a g33k, Linux blogger, developer, student and Tech Writer for Liquidweb.com\\\/kb. My passion for all things tech drives my hunt for all the coolz. I often need a vacation after I get back from vacation....\",\"sameAs\":[\"https:\\\/\\\/thelinuxreport.com\",\"https:\\\/\\\/fb.me\\\/g33kinf0\",\"https:\\\/\\\/x.com\\\/https:\\\/\\\/twitter.com\\\/drsinger1111\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"butterfly - Linux Shtuff","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/g33kinfo.com\/info\/butterfly\/","og_locale":"en_US","og_type":"article","og_title":"butterfly - Linux Shtuff","og_description":"&nbsp; From paradoxxxzero.github.io &nbsp; butterfly: your everyday terminal right in your web browser There&#8217;s something I&#8217;ve been working on recently, at start just for fun but it turned out I use it everyday, so here it is:... Read More","og_url":"https:\/\/g33kinfo.com\/info\/butterfly\/","og_site_name":"Linux Shtuff","article_publisher":"https:\/\/fb.me\/g33kinf0","article_author":"https:\/\/fb.me\/g33kinf0","article_published_time":"2014-03-02T16:33:09+00:00","og_image":[{"url":"http:\/\/paradoxxxzero.github.io\/assets\/butterfly_1.gif","type":"","width":"","height":""}],"author":"g33kadmin","twitter_card":"summary_large_image","twitter_creator":"@https:\/\/twitter.com\/drsinger1111","twitter_site":"@drsinger1111","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/g33kinfo.com\/info\/butterfly\/#article","isPartOf":{"@id":"https:\/\/g33kinfo.com\/info\/butterfly\/"},"author":{"name":"g33kadmin","@id":"https:\/\/g33kinfo.com\/info\/#\/schema\/person\/c022e4c40b13ea1b678e6f020756f547"},"headline":"butterfly","datePublished":"2014-03-02T16:33:09+00:00","mainEntityOfPage":{"@id":"https:\/\/g33kinfo.com\/info\/butterfly\/"},"wordCount":554,"publisher":{"@id":"https:\/\/g33kinfo.com\/info\/#\/schema\/person\/c022e4c40b13ea1b678e6f020756f547"},"image":{"@id":"https:\/\/g33kinfo.com\/info\/butterfly\/#primaryimage"},"thumbnailUrl":"http:\/\/paradoxxxzero.github.io\/assets\/butterfly_1.gif","articleSection":["General Info"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/g33kinfo.com\/info\/butterfly\/","url":"https:\/\/g33kinfo.com\/info\/butterfly\/","name":"butterfly - Linux Shtuff","isPartOf":{"@id":"https:\/\/g33kinfo.com\/info\/#website"},"primaryImageOfPage":{"@id":"https:\/\/g33kinfo.com\/info\/butterfly\/#primaryimage"},"image":{"@id":"https:\/\/g33kinfo.com\/info\/butterfly\/#primaryimage"},"thumbnailUrl":"http:\/\/paradoxxxzero.github.io\/assets\/butterfly_1.gif","datePublished":"2014-03-02T16:33:09+00:00","breadcrumb":{"@id":"https:\/\/g33kinfo.com\/info\/butterfly\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/g33kinfo.com\/info\/butterfly\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/g33kinfo.com\/info\/butterfly\/#primaryimage","url":"http:\/\/paradoxxxzero.github.io\/assets\/butterfly_1.gif","contentUrl":"http:\/\/paradoxxxzero.github.io\/assets\/butterfly_1.gif"},{"@type":"BreadcrumbList","@id":"https:\/\/g33kinfo.com\/info\/butterfly\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/g33kinfo.com\/info\/"},{"@type":"ListItem","position":2,"name":"butterfly"}]},{"@type":"WebSite","@id":"https:\/\/g33kinfo.com\/info\/#website","url":"https:\/\/g33kinfo.com\/info\/","name":"Linux Shtuff","description":"Because I have CRS Syndrome...","publisher":{"@id":"https:\/\/g33kinfo.com\/info\/#\/schema\/person\/c022e4c40b13ea1b678e6f020756f547"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/g33kinfo.com\/info\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/g33kinfo.com\/info\/#\/schema\/person\/c022e4c40b13ea1b678e6f020756f547","name":"g33kadmin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/g33kinfo.com\/info\/wp-content\/uploads\/2022\/07\/minion-researchA.gif","url":"https:\/\/g33kinfo.com\/info\/wp-content\/uploads\/2022\/07\/minion-researchA.gif","contentUrl":"https:\/\/g33kinfo.com\/info\/wp-content\/uploads\/2022\/07\/minion-researchA.gif","width":512,"height":512,"caption":"g33kadmin"},"logo":{"@id":"https:\/\/g33kinfo.com\/info\/wp-content\/uploads\/2022\/07\/minion-researchA.gif"},"description":"I am a g33k, Linux blogger, developer, student and Tech Writer for Liquidweb.com\/kb. My passion for all things tech drives my hunt for all the coolz. I often need a vacation after I get back from vacation....","sameAs":["https:\/\/thelinuxreport.com","https:\/\/fb.me\/g33kinf0","https:\/\/x.com\/https:\/\/twitter.com\/drsinger1111"]}]}},"_links":{"self":[{"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/posts\/5992","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/comments?post=5992"}],"version-history":[{"count":0,"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/posts\/5992\/revisions"}],"wp:attachment":[{"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/media?parent=5992"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/categories?post=5992"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/tags?post=5992"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}