Ciaran McCreesh wrote:

>On Sun, 21 Aug 2005 18:43:54 -0400 Dan Meltzer
><[EMAIL PROTECTED]> wrote:
>| putty pretends to be an xterm and dies at xtermcontrol --get-bg... I
>| can test other things if you need.. just give me some idea :)
>
>Thanks. The other useful one is to see whether it does 256 colours
>properly like real xterm does. The following bash script, when run with
>'256' as its argument, should look the same as it does when run under
>a real xterm.
>
>
>#!/usr/bin/env bash
># vim: set sw=4 sts=4 et :
>
>[[ -z "${1}" ]] && cat <<END && exit 1
>Usage: ${0} [count]
>
>count should usually be either 88 (rxvt-based terminals) or 256
>(xterm-based terminals).
>END
>
>echo -n "  0: "
>for (( a = 0 ; a < ${1} ; a++ )) ; do
>    echo -n -e "\e[38;5;${a#0}m#\e[48;5;${a#0}mX\e[0;0m "
>    [[ -z "${a##*9}" ]] && echo -n -e "\n\e[0;0m$(printf '%3d' ${a} ): "
>done
>echo -e "\e[0;0m" ; echo
>
>  
>
Probably putty use "xterm" as default instead to be usable on most
configurations.
I've found that putty is the best (free on windows) "linux" term
emulator around.
As a consequence all my win boxes use it with the following settings:

Terminal -> Keyboard -> The Functions keys and keypad -> Linux
Connection -> Data -> Terminal-type string -> "linux"

with this settings the "xtermcontrol --get-bg" output this:
xtermcontrol: TERM=linux: probably not xterm variant

The script you posted here has good results for $1 = 256 for putty
version 0.58 .
For version 0.56 of putty the for loop need to start from "13" instead
of "0" or it screwed up things at the extend that a "reset" need to be
run. Additionally  the color support is limited to 16 .

-- 
gentoo-dev@gentoo.org mailing list

Reply via email to