{"id":5504,"date":"2019-08-14T12:25:50","date_gmt":"2019-08-14T17:25:50","guid":{"rendered":"https:\/\/www.rushworth.us\/lisa\/?p=5504"},"modified":"2019-08-14T12:25:50","modified_gmt":"2019-08-14T17:25:50","slug":"software-flow-control-and-vim","status":"publish","type":"post","link":"https:\/\/www.rushworth.us\/lisa\/?p=5504","title":{"rendered":"Software Flow Control and vim"},"content":{"rendered":"<p>In the early 90&#8217;s, one of the things I liked about Microsoft&#8217;s ecosystem was that they developed a standard for keyboard shortcuts. In most applications, developed by Microsoft or not, you could hit ctrl-p to print or ctrl-x to exit. Or ctrl-s to save. It&#8217;s quite convenient when I&#8217;m using Windows applications, but hitting ctrl-s to save without really thinking about it hangs vim. Hangs like &#8220;go into another shell and kill vim &amp; that ssh session&#8221;. This is because ctrl-s, in Linux, means XOFF &#8212; the software flow control command that means &#8220;hi, I&#8217;m a thing from 1968 and my buffer is getting full. chill out for a bit and let me catch up&#8221;. Recovery is simple enough, send XON &#8212; &#8220;hi, that thing from 1968 again, and I&#8217;m all caught up. send me some more stuff&#8221;. That&#8217;s ctrl-q.<\/p>\n<p>But there aren&#8217;t many slow <em>anything<\/em>&#8216;s involved in computing these days, which means XON\/XOFF isn&#8217;t the most useful of features for most people (* if you&#8217;ve got real serial devices attached &#8230; you may not be &#8220;most people&#8221; here). Instead of remembering ctrl-q gets gets vim back without killing it, just disable START\/STOP control. Thing is it&#8217;s not really vim that&#8217;s using flow control &#8212; it&#8217;s the terminal emulator &#8212; so the &#8220;fix&#8221; isn&#8217;t something you&#8217;ll have to do in vim. In your ~\/.bashrc or ~\/.bash_profile (or globally in something like \/etc\/profile.d\/disableFlowControl.sh)<\/p>\n<p># Disable XON\/XOFF flow control so ctrl-s doesn&#8217;t hang vim<br \/>\nstty -ixon<\/p>\n<p>If you can add -ixoff to avoid ctrl-q from meaning XON too &#8230; but I don&#8217;t bother since &#8220;start sending me data&#8221; doesn&#8217;t seem to hang anything.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In the early 90&#8217;s, one of the things I liked about Microsoft&#8217;s ecosystem was that they developed a standard for keyboard shortcuts. In most applications, developed by Microsoft or not, you could hit ctrl-p to print or ctrl-x to exit. Or ctrl-s to save. It&#8217;s quite convenient when I&#8217;m using Windows applications, but hitting ctrl-s &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[30],"tags":[294],"class_list":["post-5504","post","type-post","status-publish","format-standard","hentry","category-system-administration","tag-linux"],"_links":{"self":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/5504","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5504"}],"version-history":[{"count":1,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/5504\/revisions"}],"predecessor-version":[{"id":5507,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/5504\/revisions\/5507"}],"wp:attachment":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5504"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5504"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5504"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}