
All about GNU Screen - mace
http://lugatgt.org/content/gnu_screen/downloads/presentation.pdf
======
moe
I love screen.

I use it on a daily basis for ~10 years.

What still bothers me mightily is that, up to this day, nobody has bothered to
get the history scrolling right (neither in tmux, btw). You still have to
press an awkward key combination to switch to "copy mode", the normal
mechanisms (PGUP, mousewheel, scrollbar) only result in garbage.

I've tried various partial fixes ("altscreen off") but none works properly
across sessions or with multiple windows. Years back I even tried to patch
screen myself but had to surrender over the (for me) crufty code-base.

And that despite the solution being fairly obvious: Just redraw the entire
window while scrolling, just like irssi and plenty other console apps do it.
And just like screen itself does it in copy-mode.

I wish someone would finally take on this issue...

~~~
bricestacey
You can scroll through the history of your terminal, but not of individual
screens by adding this to your .screenrc file.

termcapinfo xterm|xterm-color ti@:te@

Not 100% there, but does well for me.

~~~
moe
Yes I have that, it's the partial solution I mentioned.

It unfortunately doesn't preserve the history during detach/reattach. And the
history gets scrambled when you switch between windows.

------
wallfly
tmux is a great BSD-licensed alternative:

<http://tmux.sourceforge.net/>

I've tried both, and the licensing issue aside, I've found I prefer tmux.

Anyway, not wanting to turn this into a gnu vs. bsd, tmux vs. screen argument,
but I didn't eve know tmux existed until someone pointed me to it, so I'm just
passing on the knowledge.

~~~
mhansen
Can you elaborate on why you prefer tmux? Myself, I use byobu, a set of user-
friendly wrapper scripts around screen.

~~~
carterschonwald
off hand from just playing with tmux for the past 20 minutes, it looks like
tmux better abstracts its commands from how it internally tracks the windows
and sessions than does screen.

In particular, when i've played with screen, i found that i was frequently
stymied by the broken abstraction of the way screen stored its state vs what I
wanted to do.

byobu sadly doesn't work on macbooks, but it looks cool!

~~~
carterschonwald
to further clarify: when choosing a session (and thus a collection of
windows), in screen the process id info etc is exposed at the user level,
which perhaps is useful to someone, but not for how use terminal and such.
Thus because these things are not as directly exposed via the interaction
model that tmux does, doing stuff becomes simpler and semantically clearer

------
adulau
A nice function (not mentioned in this presentation) is the ability to send
commands (-X) to a specific window in a screen session. This allows you to
completely control GNU Screen the shell or another programming environment
while benefiting from the persistent or logging of a session.

    
    
        screen -d -m -S mysession
        screen -S mysession -X screen -a -tjob1 'top'
    

Using -X you can call the commands available within GNU Screen to control the
session or the windows.

~~~
pyre
The Gnu Screen command 'stuff' writes directly to the STDIN on the window.
This is how the REPL integration setups with screen/vim that appear on HN from
time to time work. e.g.

    
    
      screen -a window1 -X stuff 'import sys'
    

would send 'import sys' to whatever app was reading STDIN on window1.

------
luu
If you haven't heard of it, Xpra is sort of like screen for X, in that it lets
you run persistent X sessions (rootlessly, unlike VNC). Shifter
(<http://shifter.devloop.org.uk/>) packages screen and Xpra together with a
nice user-friendly interface for Windows, OpenSolaris, BSD, Mac OS, Linux,
etc., and it includes a patch for Xpra so that it works for Windows!

------
surki
I strongly recommend having a look at the Gnu Screen customization in Ubuntu
Server.

[http://blog.dustinkirkland.com/2008/12/ubuntu-server-
include...](http://blog.dustinkirkland.com/2008/12/ubuntu-server-includes-
window-manager.html)

~~~
mhansen
That project has matured a lot, it's now called byobu. It's friggin' awesome.
<https://launchpad.net/byobu>

------
Locke
I was just thinking today how wonderful it would be if my web browser let me
navigate tabs with the same key bindings as screen.

If I had a nickel for every time I've done "select all" when I wanted to
quickly switch back to the last active tab.

------
beambot
My biggest impediment to using screen is emacs key binding conflicts. I never
took the time to determine an acceptable solution. Can an emacs guru share
their solution...?

~~~
nagoff
I use backtick as the screen command, which is fine unless you write a lot of
bash scripts.

$ screen -e '``'

~~~
chrismealy
I'll give that a try ... I had to do screen -e '\\`\\`'

