Re: Using gnu screen as default login shell

From: Alan Connor (zzzzzz_at_xxx.yyy)
Date: 04/07/04


Date: Wed, 07 Apr 2004 21:47:53 GMT

On Wed, 07 Apr 2004 20:31:18 GMT, tsreyb@ <MelancholyMan@muchomail.com> wrote:
>
>
> I'm interested in using gnu screen
> (http://www.gnu.org/software/screen/screen.html) as my default login shell
> (ie, specifying it in the login shell field of /etc/passwd for my account)
>
> Ideally, I'd like to have a new screen session created each time I login.
>

Screen isn't a shell, it's a pty manager (can't call it a "window manager"
because it isn't graphical...).

Good choice. I'm using it right now, running in a x-terminal-emulator. It comes up at
login with a number of applications running in different ptys.

> I've gone as far as to specify screen as my login shell in /etc/passwd and
> actually perform a login with a screen session launched. So far, so good.
>

You should change that back to bash (or whatever) and just put:

screen

in your ~/.bash_profile (or whatever).

> The problem is when I attempt a second login, screen by default will attach
> itself to the first login screen session. That's not what I want - I'd
> prefer seperate screen sessions for each login.
>

See above.

> There appears to be a possible workaround using a combination of screen
> command switches (-d -D -r or -R) which might help. However, I cannot (or
> am not aware of how) specify command arguments via /etc/passwd. And these
> options don't seem to have equivalents in .screenrc.
>
> I'm using screen v 3.09.09 for Solaris.
>
> Anybody else attempt the same setup and have success?
>
> Thnaks in avdance,
> -Bob
> Andover, MA

You are making it much too complicated :-)

The reason I run screen out of an x-terminal-emulator is that I want to have
easy access to the few graphical apps that I use, and booting X in a seperate
tty is slow and the change from text to graphical mode is a real strain on the
'system'. (there are also other problems invovled that can drive you nuts)

Here's what my ~/.xsession looks like:

#!/bin/bash

flwm -geometry 140X60+0+0 &
WindowManager=$!
aterm -bg darkgray -geometry 110X42+0+0 -e screen
wait $WindowManager

Flwm is a light window manager and aterm a light x-terminal-emulator.

Here's a great tip I got from someone a while back. It changes your
screen escape keybinding from Ctrl-a to Ctrl-Space, and your "other"
keybinding to y. Put them under KEYBINDINGS in your ~/.screenrc:

escape '^@^@'

bind 'y' other

HTH

AC

-- 
ed(1) Check out the original tutorials by Brian W.
Kernighan at the Ed Home Page  http://tinyurl.com/2aa6g


Relevant Pages

  • Using gnu screen as default login shell
    ... specifying it in the login shell field of /etc/passwd for my account) ... am not aware of how) specify command arguments via /etc/passwd. ... options don't seem to have equivalents in .screenrc. ...
    (comp.sys.sun.apps)
  • Using gnu screen as default login shell
    ... specifying it in the login shell field of /etc/passwd for my account) ... am not aware of how) specify command arguments via /etc/passwd. ... options don't seem to have equivalents in .screenrc. ...
    (comp.unix.shell)
  • Re: Using gnu screen as default login shell
    ... I'd like to have a new screen session created each time I login. ... > options don't seem to have equivalents in .screenrc. ... screen escape keybinding from Ctrl-a to Ctrl-Space, ...
    (comp.sys.sun.apps)
  • screen within screen
    ... with the .screenrc since. ... open the same screen session exactly as I left it at work. ... because "ctrl-a d" detaches the outside ... not the inside one I want to detach. ...
    (comp.unix.shell)
  • Re: screen within screen
    ... > with the .screenrc since. ... > people find this handy like I do, where I can go home, log in via ssh, ... > open the same screen session exactly as I left it at work. ... then ssh to your host if you want the screen commands available on the ...
    (comp.unix.shell)