Tag: screen

  • Why 80 characters?

    Searching for reasonable values for the *.vt100.geometry[5-6] xterm menu font-menu options in my ~/.Xdefaults file, I re-stumbled a gem of computing history as the top-answer to a question on StackOverflow, and this pretty picture of an old IBM punch-card.

    Inspired by a perl script within the comments, I ran this shell pipe:

    2015-07-23 10:30:00 :: ~
     rons@rons-VM$ find /usr/share/terminfo/ -type f -printf '%f\n' |
       xargs -n1 infocmp | egrep -o 'cols#[0-9]+, *lines#[0-9]+' |
       sort | uniq -c | sort -nr | head
     489  cols#80,  lines#24
     58   cols#132, lines#24
     55   cols#80,  lines#25
     27   cols#80,  lines#34
     15   cols#80,  lines#40
     15   cols#80,  lines#31
     14   cols#80,  lines#33
     12   cols#126, lines#24
     10   cols#85,  lines#64
     8    cols#80,  lines#42

    Unsure if infocmp normalizes its output such that the cols and lines entries will always be adjoined, but this is good enough for my purposes.

    80×24 wins by a landslide, with 132×24 a distant second.   Then I found a Gnome help page which added 80×43 and 132×43 as options for its gooey{sic} terminal.  Next, a quick stop at the SVGA documentation in the Linux kernel with another list of common geometries.

    Finally, the Wikipedia Text Mode entry which included a neat table of common text modes:

    Text res. Char. size Graphics res. Colors Adapters
    80×25 9×14 720×350 B&W MDA, Hercules
    40×25 8×8 320×200 16 CGA, EGA
    80×25 8×8 640×200 16 CGA, EGA
    80×25 8×14 640×350 16 EGA
    80×43 8×8 640×350 16 EGA
    80×25 9×16 720×400 16 VGA
    80×30 8×16 640×480 16 VGA
    80×50 9×8 720×400 16 VGA
    80×60 16 VESA-compatible SVGA
    132×25 16 VESA-compatible SVGA
    132×43 16 VESA-compatible SVGA
    132×50 16 VESA-compatible SVGA
    132×60 16 VESA-compatible SVGA

    I think I’ll go with 80×50 and 132×60.

     

  • Stuffing Text Into All Screen Windows

    Various pagers have been giving me question marks in boxes and hexadecimal codes.  This is probably because I didn’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’ve just about got everything right and proper in UTF-8 mode using a uxterm, but those little nigglers still pop up.  Today I did a man less and found the LESSCHARSET environment variable.  Awesome!  But if it’s not set, it’s supposed to use the locale, and my locale is already properly set up to en_US.utf-8.  Not a problem.  I just export -n LESSCHARSET to un-export the variable.

    But I’m in screen, with fourteen windows open.  How do I loop through all screen windows, stuffing a command into each?

    Luckily, a quick reading of the screen man page led me to this:

    at \# stuff "export -n LESSCHARSET\015source ~/.bash/aliases\015
    

    And BAM that gets stuffed into every window I have open.  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.

    The trick is to use the backslash-escaped octothorpe to specify all windows.  The rest is just a normal stuff, with that annoying octal \015 to specify a newline.

    Oh, and I added a second command to source my bash aliases, because I’d added new ones recently.