Live data from Hacker News

GNU Screen - A Hacker's Ideal Terminal

ibm.com

41–50 of 103 posts

Re: GNU Screen - A Hacker's Ideal Terminal

#41

I've been satisfied with just using multiple tabs in Terminal.app in OS X, but I'm curious if anyone has switched from that solution to screen and wouldn't go back? (for local use in particular)

I use screen constantly and would never go back. The detachability is incredibly useful. Say I had to go to a meeting - I shut my laptop and it goes to sleep. This would normally kill any SSH session (and thus leave vim swap files lying about in my case)... but with screen I can just pick up where I left off last time. It's also great if you want to run something big - say a job that would take 5 hours. I'm free to d…

> run something big - say a job that would take 5 hours

The monitor function can also notify you when there's activity or 30 sec. silence in a window, too. :)

Re: GNU Screen - A Hacker's Ideal Terminal

#42
post #34

Earlier quoted context omitted.

For starters, it has built-in dwm/XMonad-style layouts, while screen has taken ages to even get vertically split windows.

In general, one should probably know their way around GNU screen in addition to tmux just because you'll probably encounter it on more installations. Much in the same way that it's really to your benefit to know a bit about vi even if you are an Emacs user.

Agreed. They're both incredibly handy, and even if you only learn the common feature subset, it's still a huge win.

Re: GNU Screen - A Hacker's Ideal Terminal

#43
I use screen every day for administering multiple remote servers. I don't know how I functioned before I used screen. One of the coolest things are "backtick" commands you can put in the caption string. Here is a pastie of my screenrc and one of the backtick files which displays the free RAM of the system in the caption line, updating every 30 seconds (ymmv on the free RAM command depending on how your distro's `free` command displays its output)

http://pastie.org/633808

Re: GNU Screen - A Hacker's Ideal Terminal

#44
I often use idiosyncratic screen setups with very specifically-purposed windows. I support this behavior with a special config file that launches screen with certain windows pre-loaded for certain uses:

  source /home/mcantor/.screenrc
  chdir $SANDBOX/src
  screen 0:svn
  screen 1:lib
  screen 2:nosetests
  stuff "activate_environment\015"
  screen 3:ipython
  stuff "activate_environment\015ipython\015"
  screen 4:
  select 0
I use stuff because it's the most straightforward way to send commands with carriage returns (015 in octal) to a window.

I make this even more effortless by using a special alias in my .bashrc:

  alias scd='screen -c /home/mcantor/.screenrc-dev'
I also use a few other aliases to support common uses:

  alias scr='screen -rd'
  alias scx='screen -x'
  alias lsc='screen -list'
Also, don't forget the very useful -S switch:

  screen -S someproject
Or, you can use Ctrl-a :sessionname, if you're already within a session, to rename it. That way, screen -list and screen -r can use your sessionnames, and you don't have to parse or remember the process ID's.

Re: GNU Screen - A Hacker's Ideal Terminal

#45
post #32

anyone care to share their screenrc? heres mine: http://github.com/bdotdub/dotfiles/blob/master/screenrc

The most notable part of mine is

   # Set up my status line at the bottom of every frame
   caption always "%{gb}  %{ck}%m-%d %C %{gb}  %{gb}%?%-Lw%?%{ck}%n*%f %t%?(%u)%?%{gb}%?%+Lw%?"
I use tmux now, though. (it has a statusbar similar to the above by default)

Re: GNU Screen - A Hacker's Ideal Terminal

#46
post #28
post #19

Earlier quoted context omitted.

I'm just curious- Why would you want to specifically avoid the GPL?

The same way there are people that want their entire software usage to be GPL/MIT/BSD/etc, there are people that want everything to be non-GPL. Unless you are going to be hacking on GNU Screen and feel the need to do something that the GPL forbids, there's really no reason to stop yourself from using a software package just because it's GPL-licensed.

I think it's ironic that your argument is remarkably similar to "nothing stops you from using a closed source program unless you planned to start hacking on the source." Sometimes you don't know when you start using something what amount of hacking may be required.

Re: GNU Screen - A Hacker's Ideal Terminal

#47
This IS a hacker's ideal Terminal - a while ago I set out to write my own shell with all the features I wanted. A huge portion of the functionality I intended to implement is accomplished with GNU Screen. Since I found Screen - I haven't felt enough need to keep developing my own shell!

Re: GNU Screen - A Hacker's Ideal Terminal

#48

I've been satisfied with just using multiple tabs in Terminal.app in OS X, but I'm curious if anyone has switched from that solution to screen and wouldn't go back? (for local use in particular)

You can copy and paste between terminals with the keyboard. This alone should be reason enough.

Re: GNU Screen - A Hacker's Ideal Terminal

#49
In the same vein, if you use a repl on a remote machine you should check out detachtty if you're not already using it. It's particularly nice for use within emacs because it doesn't eat the whole screen and it doesn't eat ^A.

Re: GNU Screen - A Hacker's Ideal Terminal

#50

I've been satisfied with just using multiple tabs in Terminal.app in OS X, but I'm curious if anyone has switched from that solution to screen and wouldn't go back? (for local use in particular)

I use screen constantly and would never go back. The detachability is incredibly useful. Say I had to go to a meeting - I shut my laptop and it goes to sleep. This would normally kill any SSH session (and thus leave vim swap files lying about in my case)... but with screen I can just pick up where I left off last time. It's also great if you want to run something big - say a job that would take 5 hours. I'm free to d…

Your second scenario can be handled with nohup from within a vanilla ssh session.
Post reply on HN