Does anyone know a way to change the default 80 columns width when starting screen in 'detached' mode (screen -dm) ?
Smart curses apps like htop handle resizing when attaching from a wide terminal later on, but for dumb scripts like this it's too late :
#!/bin/bash echo "Scanning packages:" COLUMNS=132 dpkg -l | tr '\n' '\r' echo "" echo "Done" Direct screen session (from a wide term) works fine :
$ screen bash -c './myscript ; exec bash' Scanning packages: ii zlib1g-dev:i386 1:1.2.8.dfsg-1ubun i386 compression library - developmentom shell scripts (common f Done But in 'detached' mode 80 columns width messes up everything :
$ screen -dm bash -c './myscript ; exec bash' $ screen -r 2.10.1-1ubuntu1 all X Keyboardii xloadimage 4.1-22 i386 Graphics fii xml-core 0.13+nmu2 all XML infrasii xorg 1:7.7+1ubuntu8 i386 X.Org X Wiii xorg-docs-core 1:1.7-1 all Core documii xorg-sgml-doctools 1:1.11-1 all Common tooii xserver-common 2:1.15.1-0ubuntu2. all common filii xserver-xephyr 2:1.15.1-0ubuntu2. i386 nested X sii xserver-xorg 1:7.7+1ubuntu8 i386 X.Org X seii xserver-xorg-core 2:1.15.1-0ubuntu2. i386 Xorg X serii xserver-xorg-input-all ... Looks like neither stty, width command or COLUMNS env variable is going to do it here, really need a way to start with a wider term ...
focusminsizein your screenrc help?focusminsizeso far ...