Page 1 of 1

GNU Screen-4.0.3 + Vpatch + $TERM patch

Posted: Wed 14 Nov 2012, 19:58
by GustavoYz
--------------------------------------------------------------
There is a "bug" on screen in general, about the termcap
entries on terminal with 256 colors (`$TERM too long`).

I checked the source code and the string length '20' is hard
coded somehow, so it cannot support 'rxvt-unicode-256color'
(just 21 chars :twisted: ).
--------------------------------------------------------------
On one system, I tried to hack the termcaps (copied via
`infocmp` the old rxvt-unicode-256color' into a custom
'urxvt-256color', edit the /etc/termcap file, the terminfo
files for screen...) but not success.
Then I made the test of change those '20' values and worked
(supports my custom $TERM with 256 colors, non custom ones
too), no problems on color part, although it crashed several
times... :roll:
Luckily, found a patch somewhere that does the same I tried,
but better... As far as I know, it works fine.


TO COMPILE

:arrow: Here will find the patched sources (vpatch + long $TERM names patch applied and already on the source).
:arrow: Here and here will find both patches. To apply, extract source code, `cd` into that dir and run:

Code: Select all

patch -p1 < longTerm_name_00.diff 
(may get some warnings with that one).
:arrow: To compile it, I'd use:

Code: Select all

./configure --prefix=/usr --with-sys-screenrc=/etc/screenrc --with-pty-mode=0620 --with-pty-group=5 --disable-socket-dir --enable-locale --enable-colors256 --enable-rxvt_osc && make
but on some Puppies, u/rxvt may lack of OSC support.

Then `make install` or, if want to build pet package, install it on a new directory

Code: Select all

make --DESTDIR=/root/screen-4.0.3 install 
and `dir2pet` it.

SCREEN 256 color test

If all is working and run this code from a screen session:

Code: Select all

( x=`tput op` y=`printf %$((${COLUMNS}-6))s`;for i in {0..256};do o=00$i;echo -e ${o:${#o}-3:3} `tput setaf $i;tput setab $i`${y// /=}$x;done; )
should be able of see gradients between "xcolors" (requires tput).

This perl script test it (nothing extra required for run it), and this one too (vim isn't neded, just Perl).

To check how many colors your actual terminal support, run:

Code: Select all

tput colors
and to check $TERM, simply:

Code: Select all

echo $TERM
:arrow: Added.
If want to see those suppoted colors with numbers:

Code: Select all

perl -E 'say $_,`tput setb $_`," "x(`tput cols`-length("$_")),`tput sgr0` for 0..(`tput colors`-1)'

Posted: Fri 16 Nov 2012, 11:40
by Iguleder
Awesome! Great work! :D

Posted: Fri 16 Nov 2012, 19:28
by GustavoYz
Thanks! :D