5

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 ...

2
  • Does setting focusminsize in your screenrc help? Commented Jan 8, 2016 at 11:41
  • hmm, no luck with focusminsize so far ... Commented Jan 9, 2016 at 0:15

1 Answer 1

0

If you can use tmux instead, it allows you to specify the width:

tmux new-session -d -x 300 bash -c './your-script.sh' 

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.