Patching GNU Screen with vertical split support in OS X

I’ve been mean­ing to spend more time with Screen for a while, but until recently haven’t had a con­crete need for it. Thank­fully, one has been pro­vided by my quest to turn my Cr-48 into a pass­able dev machine.

Long, tan­gen­tial story short, I planned to ssh from the Cr-48 to my Mac­Book Pro and run Screen to facil­i­tate con­text switch­ing. The scheme I had in mind was to split the screen win­dow ver­ti­cally in order to make bet­ter use of ter­mi­nal space. How­ever, the ver­sion of screen sup­plied with OS X 10.6.5 (v4.00.03) doesn’t sup­port ver­ti­cal win­dow split­ting. A bit of Googling revealed that this is a com­mon prob­lem and I zeroed in on a Mac-centric solu­tion before find­ing that the spec­i­fied win­dow­size patch doesn’t work.

In par­tic­u­lar, patch-windowsize fails due to an added 2-line con­di­tional state­ment within resize.c. I’ve put together a sin­gle patch that fixes the prob­lem. Other than using this sin­gle patch, the instruc­tions are iden­ti­cal to those in the pre­vi­ously linked article:

Voila! As men­tioned in the other arti­cles, ver­ti­cal split­ting is by default bound to ctrl+a |.

DISCLAIMER: Fol­low this guide at your own risk. The pre­scribed steps worked for my par­tic­u­lar OS X envi­ron­ment, but YMMV.

  • Pingback: Adding Vertical Split support to GNU Screen in Mac OS X Snow Leopard at Otaqui.Com

  • Ben Bur­ton

    You’ve got a typo in the sec­ond line… > gnu-screen-vertcplit.patch should be > gnu-screen-vertsplit.patch

  • Evan Meagher

    Good catch. Thanks!

  • Puntme

    Hey this rocks, thanks!

  • Mike Wabst

    You are a saint among men. Thanks!

  • kittu

    How do I unin­stall this?

  • kittu

    How do I unin­stall this?

  • Ralt

    You, sir, has made my day.

  • Feanor11

    Thank you very much ! It worked for me.

  • Muwazi Daniel

    Hi its been a while since you posted this, yet there are still new­bies like me who are grate­ful that you did!  Thanks alot! 

  • Ted­drick Kensington

    Works well @ 10.8.2 Thanks for tak­ing the time to fig­ure this out.

  • A.I

    THANK YOU!!!!!!!!

  • Lydia Jones

    Three years later and still work­ing. Noth­ing like a google search that gives you exactly what you’re look­ing for! Thanks!!!!!

  • Roger

    Awe­some post, still works!

  • Natalie Wolfe

    Only thing that would make this bet­ter would be to remove the ‘$’ at the begin­ning of each line to bet­ter facil­i­tate copy-paste directly to the terminal.

  • Henry Lin

    Uhh.… yeah, I installed this, and now none of my screen com­mands are work­ing =‘[ (let along ctrl-a |)

  • Henry Lin

    Yeah, I need to unin­stall this too. This actu­ally wrecked my screen com­mands for some rea­son, let alone ctrl-a |

  • Evan Meagher

    Have you tried rebuild­ing from source with a clean screen repos­i­tory? There isn’t really a straight­for­ward way to unin­stall a patch from a com­piled binary.

  • Henry Lin

    I should have replied to this ear­lier, sorry!

    The con­text of which I was try­ing to using screen was when I was SSH­ing into a com­puter. For the life of me, I couldn’t fig­ure out why screen wasn’t work­ing, even though it was work­ing before the update.

    Then I tried SSH­ing — with screen mode turned on. Pre­vi­ously I didn’t need to do that, but when I did, screen started work­ing again.

    So all in all, it works. Thanks!

  • ben­lind

    Great patch, thanks!

  • Abhi­manyu Aryan

    Will this patch work on El Cap­tain? It has sys­tem integrity pro­tec­tion fea­ture “ON”. I am not sure if it will allow that

  • Ivan Tem­chenko

    For those who is still pre­fer using screen on lat­est MacOS, patch worked fine with lat­est src on High Sierra, but now it is for­bid­den to install into ‘/usr/bin’, so had to add pre­fix ‘/usr/local’ dur­ing con­fig­ure and alias for .bashrc to start patched one from ‘/usr/local/bin’ as can­not link it into /usr/bin post install. Default one remained same unpatched. Good luck ;)