Skip to content

Instantly share code, notes, and snippets.

@npho
Created June 24, 2015 22:30
Show Gist options
  • Save npho/6224d1bcdf257a65c8e2 to your computer and use it in GitHub Desktop.
Save npho/6224d1bcdf257a65c8e2 to your computer and use it in GitHub Desktop.
Brew formula for GNU screen with the vertical split
require 'formula'
class ScreenVerticalSplit < Formula
homepage 'http://www.gnu.org/software/screen/'
url 'http://ftp.gnu.org/gnu/screen/screen-4.0.3.tar.gz'
mirror 'http://ftp.gnu.org/gnu/screen/screen-4.0.3.tar.gz'
sha256 '78f0d5b1496084a5902586304d4a73954b2bfe33ea13edceecf21615c39e6c77'
head 'git://git.savannah.gnu.org/screen.git', :branch => 'master'
if ARGV.build_head?
depends_on 'autoconf'
depends_on 'libtool'
depends_on 'automake'
end
def install
if ARGV.build_head?
Dir.chdir('src')
system "./autogen.sh"
end
system "./configure", "--enable-colors256",
"--prefix=#{prefix}",
"--mandir=#{man}",
"--infodir=#{info}"
if ARGV.build_head?
system 'bash osdef.sh'
end
system "make"
system "make install"
end
end
@npho
Copy link
Author

npho commented Jun 24, 2015

Borrowed from Masahiro Morinaga, install with 2-liner below,

curl https://gist.githubusercontent.com/nampho2/6224d1bcdf257a65c8e2/raw/eaff271c0d0423018092d17f70d00a09a41d762b/screen-vertical-split.rb > /usr/local/Library/Formula/screen-vertical-split.rb
brew install screen-vertical-split --HEAD

@npho
Copy link
Author

npho commented Jun 24, 2015

A useful .screenrc file example,

autodetach on
defscrollback 9000
startup_message off

hardstatus off
hardstatus alwayslastline
hardstatus string "%{= bW}[ %H %l ]%?([ %{rW}%u%{-} ])%?[ %-w%{rW}%n*%t%{-}%+w %= ][ %D %m/%d/%y | %c:%s ]"

@npho
Copy link
Author

npho commented Jun 24, 2015

Useful snippet for your .bashrc file to automatically rename all your screen titles to the machine's hostname,

# Set screen window title
case "$TERM" in
screen)
  PROMPT_COMMAND='echo -ne "\033k`hostname -s`\033\\"'
  ;;
esac

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