On Tue, Sep 23, 2025 at 10:11:18AM +0100, Chris Green wrote: > On Mon, Sep 22, 2025 at 05:11:55PM -0400, Thomas Dickey wrote: > > On Mon, Sep 22, 2025 at 03:13:20PM +0100, Chris Green wrote: > > > I have just bought an Android tablet to use in preference to my > > > Android smartphone. I am trying to get colours to work in vile on the > > > new tablet but I'm failing at the moment. > > > > hmm - I don't have something like that, for testing. > > But I can make guesses :-) > > > Yes, I realise it's a bit of a 'niche' use! :-) > > > > > Both have vile 9.8z installed. I have (I think!) copied all the vile > > > configuration files across from the old one (where syntax > > > highlighting works) to the new one (where it doesn't). > > > > > > They have virtually identical .profile and .bashrc, they have > > > identical .vile.keywords and .vilerc files. Directory colouring works > > > OK on the new one but I can't get any colour within vile on the new > > > one. > > > > > > I have tried running the syntax highlighting commands manually by > > > doing the following line by line in the new device:- > > > > > > source filters.rc > > > setv $autocolor-hook HighlightFilter > > > setv $read-hook HighlightFilter > > > set autocolor=500 > > > set bcolor=default > > > > running "vile -D" will turn on the trace feature. You might see some > > issue in the [Trace] buffer, i.e., not reading one of the scripts. > > > I've done that and I couldn't see anything significantly wrong, just a > few mild warnings about tests comparing different types of variable. > There were no configuration files that couldn't be read. > > > > The [Variables] display would show how vile is compile-time configured. > > For instance, I have (among other settings): > > > > $cfgopts = hypertext,locale,iconv,multibyte,perl,terminfo > > $filter-list = c key m4 perl raku ruby sed tags ada as asm au3 awk basic > > bat bnf cfg conf css cweb dcl def diff ecl erl esql est fdl hs html imake > > info ini iss json latex lex lisp lua mail mailcap make mcrl md midl mms > > nmake nr pas php pot ps ps1 py rc rcs rexx rpm rtf rust sccs scheme sh > > sml spell sql tbl tc tcl texi ti tpu txt vile vlog wbt xml xq xres xs yacc > > yaml > > $startup-file = .vilerc > > $startup-path = /usr/share/vile > > > > If it's listing "terminfo", "termcap" or curses in $cfgopts, then it could > > be using ncurses. > > > The $cfgopts variable is the same on both systems:- > > $cfgopts = hypertext,locale,multibyte,terminfo
vile's not doing much to check if colors are available, just "colors" in
the terminfo entry:
#if OPT_COLOR
if ((j = TGETNUM(CAPNAME("Co", "colors"))) > 0)
set_colors(j);
else
set_colors(2); /* white/black */
#endif
> Running diff to compare the whole of the output of
> show-system-variables just produces:-
>
> chris$ diff bisonvars m986vars
> 61c61
> < $lastkey = 10
> ---
> > $lastkey = 32
> 89c89
> < $pid = 5707
> ---
> > $pid = 15143
> 103c103
> < $status = TRUE
> ---
> > $status = FALSE
> 115c115
> < $wlines = 52
> ---
> > $wlines = 14
>
> (The old phone is an Umidigi Bison, the new tablet is an m986, main
> stream I am not! :-) )
>
> > > No errors are reported but there's no colours.
> >
> > It might be simply a missing terminal description. "directory colors"
> > aren't
> > helpful since (referring to dircolors and such) it's mostly hardcoded
> > (i.e., with little relationship to ncurses).
> >
> Both systems have TERM set to 'xterm' and as far as I can see the
> terminfo files are identical.
I suppose that's checking with infocmp (which also shows where the
terminfo is read from).
If it were xterm-256color, then some old versions of ncurses
(older than I'd expect..) would have problems with its
pairs#0x10000,
but "xterm" should just have colors#8 and pairs#64, as in this chunk:
# Reconstructed via infocmp from file:
/usr/local/ncurses/share/terminfo/e/ecma+color
ecma+color|color control for ECMA-48-compatible terminals,
colors#8, ncv#3, pairs#64,
op=\E[39;49m, setab=\E[4%p1%dm, setaf=\E[3%p1%dm,
> If I ssh **from** the m986 tablet to another system and run vile on
> the other system using the tablet screen then I do get colours. The
> other way around, ssh **to** the m986 and run vile displaying on the
> other system's screen then I don't get colours. So it is just vile on
> the m986 system which is colourless.
ssh is usually setup to pass $TERM (iirc, even OpenBSD allows this :-)
In 2015 (ncurses 6.0), I added to the $TERMINFO variable in case
that's been allowed via ssh:
• If the value of TERMINFO begins with “hex:” or “b64:”, ncurses uses
the remainder of the value as a compiled terminfo description. You
might produce the base64 format using infocmp(1).
TERMINFO=$(infocmp -0 -Q2 -q)
export TERMINFO
The compiled description is used only if it corresponds to the ter‐
minal type identified by TERM.
making it possible to dispense with copying terminfo stuff around.
>
> It's not a big deal, I'm not really aiming to do heavy program editing
> on the tablet, it's just mildly annoying.
>
> Thanks for your ideas and time.
>
> --
> Chris Green
>
>
>
--
Thomas E. Dickey <[email protected]>
https://invisible-island.net
signature.asc
Description: PGP signature
