{"id":181,"date":"2011-04-18T09:48:47","date_gmt":"2011-04-18T13:48:47","guid":{"rendered":"http:\/\/fazigu.org\/blog\/?p=181"},"modified":"2011-04-20T08:00:30","modified_gmt":"2011-04-20T12:00:30","slug":"stuffing-text-into-all-screen-windows","status":"publish","type":"post","link":"https:\/\/fazigu.org\/blog\/2011\/04\/18\/stuffing-text-into-all-screen-windows\/","title":{"rendered":"Stuffing Text Into All Screen Windows"},"content":{"rendered":"<p>Various pagers have been giving me question marks in boxes and hexadecimal codes.\u00a0 This is probably because I didn&#8217;t have the right font in the past and inserted various hacks into my <tt>~\/.bash<\/tt> tree to get around them, e.g. aliasing a <span style=\"font-family: consolas, 'courier new', courier, monospace;\"><tt>LANG=C<\/tt><\/span> before every perldoc command.<\/p>\n<p>Well, now I&#8217;ve just about got everything right and proper in UTF-8 mode using a <em>uxterm<\/em>, but those little nigglers still pop up.\u00a0 Today I did a <span style=\"font-family: consolas, 'courier new', courier, monospace;\">man less<\/span> and found the <tt>LESSCHARSET<\/tt> environment variable.\u00a0 Awesome!\u00a0 But if it&#8217;s not set, it&#8217;s supposed to use the locale, and my locale is already properly set up to <tt>en_US.utf-8<\/tt>.\u00a0 Not a problem.\u00a0 I just <tt>export -n LESSCHARSET<\/tt> to un-export the variable.<\/p>\n<p>But I&#8217;m in screen, with fourteen windows open.\u00a0 How do I loop through all screen windows, stuffing a command into each?<\/p>\n<p>Luckily, a quick reading of the screen man page led me to this:<\/p>\n<pre lang=\"sh\">\r\nat \\# stuff \"export -n LESSCHARSET\\015source ~\/.bash\/aliases\\015\r\n<\/pre>\n<p>And BAM that gets stuffed into every window I have open.\u00a0 Unfortunately, some of those are SQL prompts, log tails, and maybe an open vim session or two, but such are the pitfalls of impatiently trying out a new command, and no harm was done.<\/p>\n<p>The trick is to use the backslash-escaped octothorpe to specify all windows.\u00a0 The rest is just a normal stuff, with that annoying octal <tt>\\015<\/tt> to specify a newline.<\/p>\n<p>Oh, and I added a second command to source my bash aliases, because I&#8217;d added new ones recently.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Various pagers have been giving me question marks in boxes and hexadecimal codes.\u00a0 This is probably because I didn&#8217;t have the right font in the past and inserted various hacks into my ~\/.bash tree to get around them, e.g. aliasing a LANG=C before every perldoc command. Well, now I&#8217;ve just about got everything right and [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[15],"tags":[29,26,28,30],"class_list":["post-181","post","type-post","status-publish","format-standard","hentry","category-hacking","tag-bash","tag-linux","tag-screen","tag-unicode"],"_links":{"self":[{"href":"https:\/\/fazigu.org\/blog\/wp-json\/wp\/v2\/posts\/181","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fazigu.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fazigu.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fazigu.org\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fazigu.org\/blog\/wp-json\/wp\/v2\/comments?post=181"}],"version-history":[{"count":6,"href":"https:\/\/fazigu.org\/blog\/wp-json\/wp\/v2\/posts\/181\/revisions"}],"predecessor-version":[{"id":190,"href":"https:\/\/fazigu.org\/blog\/wp-json\/wp\/v2\/posts\/181\/revisions\/190"}],"wp:attachment":[{"href":"https:\/\/fazigu.org\/blog\/wp-json\/wp\/v2\/media?parent=181"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fazigu.org\/blog\/wp-json\/wp\/v2\/categories?post=181"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fazigu.org\/blog\/wp-json\/wp\/v2\/tags?post=181"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}