Skip to content

Instantly share code, notes, and snippets.

@bigeasy
Created April 7, 2012 10:12
Show Gist options
  • Save bigeasy/2327150 to your computer and use it in GitHub Desktop.
Save bigeasy/2327150 to your computer and use it in GitHub Desktop.
How to install GNU Screen on OS X using Homebrew.

Installing GNU Screen on OS X in Homebrew

I want to edit in one tab, run what I edit in the other. Typical multi-view stuff. I've used Terminal.app for the last few years. Lately, however, after not long enough, Terminal gets laggy when I switch between tabs.

The stutter between edit and run is annoying, an unnacceptable. One of the major reason I've chosen to work with character based UI is because it is snappy. There shouldn't be a lag while a screen of UTF-8 is rendered in a monospace font.

The lag gets progressively longer, chipping at my productivity with irritation. The only solution is to kill all my Terminals, which essentially kills my flow. Terminal.app won't remember where I was for me. I have to initialize ever tab.

GNU Screen

Back in the day I'd use GNU Screen. GNU Screen gives you different windows that you use keyboard commands to alternate between, but in a single terminal window.

I can't remember all that I did with it, but I developed a lot of muscle memory around it.

There was a lot more to learn about GNU Screen that I didn't learn. You can navigate your scrollback buffer from the keyboard, cutting and pasting. You can detach screen, close your terminal, then open a new terminal and reattach. Screen will be as you left it.

I'd much rather develop muscle memory that I can take with me to Linux. The only thing that Terminal.app gives me is tabs. Screen gives me tabs, keyboard scrollback, split windows, and saved detached sessions.

256 Colors

Sadly, I found that the screen that comes with OS X does not support 256 colors. Starting with this article GNU/Screen with 256 colours in Mac OS X, I built GNU Screen as follows.

git clone git clone git://git.savannah.gnu.org/screen.git
cd screen/src
mkdir -p /opt/etc
mv etc/etcscreenrc /opt/etc/screenrc
./autogen.sh
./configure --prefix=/opt/Cellar/screen/3.6.0  --enable-colors256 --with-sys-screenrc=/opt/etc/screenrc
make
make install
brew link screen

Now I can run screen and see that I have 265 colors.

@FreedomBen
Copy link

You may also try using screen-for-osx. This is a relatively recent, stable version of screen that supports vertical splits. All of the Apple patches are pre-applied so you can just build and install.

https://github.com/FreedomBen/screen-for-OSX

@nitin9791
Copy link

showing exec: autoreconf: not found on my screen

@Dispader
Copy link

@snackycracky It looks like you've installed the homebrew/dupes version of screen. I'm partial to that, myself.

An alternative to changing around symbolic links within your environment is to put the GNU utilities farther up in your path

export PATH="$(brew --prefix coreutils)/libexec/gnubin:/usr/local/bin:$PATH"

as suggested by Hong Xu's most excellent post, "Install and Use GNU Command Line Tools on Mac OS X".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment