GNU Screen-4.0.3 + Vpatch + $TERM patch

discuss compiling applications for Puppy
Post Reply
Message
Author
User avatar
GustavoYz
Posts: 883
Joined: Wed 07 Jul 2010, 05:11
Location: .ar

GNU Screen-4.0.3 + Vpatch + $TERM patch

#1 Post 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)'
Attachments
screen.jpg
(42.33 KiB) Downloaded 1071 times
screen_256colors.jpg
For `gradients` I mean this.
(13.53 KiB) Downloaded 986 times
Last edited by GustavoYz on Thu 22 Nov 2012, 01:51, edited 1 time in total.

User avatar
Iguleder
Posts: 2026
Joined: Tue 11 Aug 2009, 09:36
Location: Israel, somewhere in the beautiful desert
Contact:

#2 Post by Iguleder »

Awesome! Great work! :D
[url=http://dimakrasner.com/]My homepage[/url]
[url=https://github.com/dimkr]My GitHub profile[/url]

User avatar
GustavoYz
Posts: 883
Joined: Wed 07 Jul 2010, 05:11
Location: .ar

#3 Post by GustavoYz »

Thanks! :D

Post Reply