{"id":998,"date":"2009-10-02T16:00:59","date_gmt":"2009-10-02T23:00:59","guid":{"rendered":"https:\/\/www.reenigne.org\/blog\/?p=998"},"modified":"2009-09-30T11:42:51","modified_gmt":"2009-09-30T18:42:51","slug":"text-editor-as-shell","status":"publish","type":"post","link":"https:\/\/www.reenigne.org\/blog\/text-editor-as-shell\/","title":{"rendered":"Text editor as shell"},"content":{"rendered":"<p>The text editor interface I talked about yesterday is so good I find myself wanting to use for things other than text editing. In particular, I&#8217;d love to be able to use it as my command line interface. Most command line shells are annoying because you can&#8217;t use the keyboard to move the cursor up into a program&#8217;s output to copy it &#8211; you generally have to resort to the mouse. I think it would be far better to treat the entire command-line session as a document. One way to do this would be to have a text editor with a special key combination (say Ctrl+Enter) which takes the contents of the current line, executes it as a command, and pastes the resulting output into the document immediately below, followed by a prompt, followed by the cursor.<\/p>\n<p>One useful aspect of command line interfaces is tab completion &#8211; it would be nice if there were a way to make this continue to work in the editor interface. Perhaps tab could be interpreted to mean &#8220;tab completion&#8221; if the line above the cursor was a prompt (maybe prompt lines are &#8220;special&#8221; in some way, though that counteracts the principle that there should be no &#8220;hidden&#8221; information). If prompt lines are special, then maybe pressing Enter on the line below would suffice for running commands, instead of a special key combination for this.<\/p>\n<p>A variation on this idea would be to allow editing of multiple files in a single buffer. Suppose you&#8217;re using the editor interface and &#8220;cat&#8221; (Unix) or &#8220;type&#8221; (Windows) the contents of a file, causing it to be inserted into the buffer. I think it would be tremendously useful if that file was then &#8220;live&#8221; and could be edited by just moving the cursor up into its contents, changing things, and then hitting some other key (perhaps Alt+S?) to save it. Again this goes against the &#8220;no hidden information&#8221; principle, though. Perhaps one of the ASCII control codes that aren&#8217;t usually found in text files could be repurposed to have special meaning to the editor, to signify a line that is a prompt or contains the path to an embedded file.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The text editor interface I talked about yesterday is so good I find myself wanting to use for things other than text editing. In particular, I&#8217;d love to be able to use it as my command line interface. Most command line shells are annoying because you can&#8217;t use the keyboard to move the cursor up [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-998","post","type-post","status-publish","format-standard","hentry","category-computer"],"_links":{"self":[{"href":"https:\/\/www.reenigne.org\/blog\/wp-json\/wp\/v2\/posts\/998","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.reenigne.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.reenigne.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.reenigne.org\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.reenigne.org\/blog\/wp-json\/wp\/v2\/comments?post=998"}],"version-history":[{"count":2,"href":"https:\/\/www.reenigne.org\/blog\/wp-json\/wp\/v2\/posts\/998\/revisions"}],"predecessor-version":[{"id":1000,"href":"https:\/\/www.reenigne.org\/blog\/wp-json\/wp\/v2\/posts\/998\/revisions\/1000"}],"wp:attachment":[{"href":"https:\/\/www.reenigne.org\/blog\/wp-json\/wp\/v2\/media?parent=998"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.reenigne.org\/blog\/wp-json\/wp\/v2\/categories?post=998"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.reenigne.org\/blog\/wp-json\/wp\/v2\/tags?post=998"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}