Subject: resize a screen on creation?

From: "Aaron Davies" <[email-masked]>
Date: Wed, 3 Sep 2008 09:32:40 +0800

this is trivial, but it's been bugging me for a while. when i add a
bunch of screens at once from inside a running screen (using a shell
loop or something) all but the first don't resize to match the
terminal window until they're focused--when i first jump to them, if
it's running a shell, the prompt will be positioned 24 lines from the
bottom of the window, not at the top; if it's running a curses app, it
will be sized for 24x80; etc. Also, my caption won't add any but the
first new screen until I change screens again (or issue :redisplay).
Any way around either of these? (i should mention i'm running screen
4.00.02, the stock version for SuSE 9.3, so if these are fixed in HEAD
or something, that's cool too. :)
-- 
Aaron Davies
[email-masked]

_______________________________________________
screen-users mailing list
[email-masked]
http://lists.gnu.org/mailman/listinfo/screen-users

---

From: "Andy Harrison" <[email-masked]>
Date: Wed, 3 Sep 2008 13:33:11 -0400

> or something, that's cool too. :)

If you have your COLUMNS and LINES environment variables populated,
screen honors them.

I tried this in my .tcshrc file (which would be much much simpler to
express in your .bashrc file) and it seems to solve that annoyance
just fine.

set screen_size = ( `stty size` )

if ( ! $?LINES && ! $?COLUMNS ) then
    foreach element ( $screen_size )
        if ( ! $?LINES ) then
            setenv LINES $element
        endif

        if ( ! $?COLUMNS ) then
            setenv COLUMNS $element
        endif
    end
endif

- --
Andy Harrison
public key: 0x67518262

---

From: "Aaron Davies" <[email-masked]>
Date: Thu, 4 Sep 2008 08:42:46 +0800

> express in your .bashrc file) and it seems to solve that annoyance

hmm. before i can see if that works for me, i think i need to solve a
possibly related problem: my LINES and COLUMNS vars don't even make it
into screen. i have `eval resize` near the end of my .bash_profile,
which sets and exports them, so they should show up in any subprocess,
right? i don't have any shell setting in my .screenrc, so screen
should run non-login instances of my regular shell, i.e. bash w/the
.bashrc executed, but not the .bash_profile. nonetheless, after login
but before starting screen, i find that LINES and COLUMNS are set;
after starting screen and checking from inside, i find that they're
not. why are they not getting passed down?
-- 
Aaron Davies
[email-masked]

---

From: "Andy Harrison" <[email-masked]>
Date: Thu, 4 Sep 2008 09:47:36 -0400

> not. why are they not getting passed down?

Sorry, this important tidbit slipped my mind.  It's not screen that
honors COLUMNS and LINES, it's the shell itself.   So you need to make
sure the  snippet of code that determines LINES and COLUMNS is in your
shell's rc file on the remote host as well.  I tested it to make sure
and doing it this way works fine for me.  I didn't test bash, just
tcsh (including a very very old tcsh version 6.11.0 on one of my
boxes) and the annoyance vanishes.

- --
Andy Harrison
public key: 0x67518262