[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[screen-devel] [bug #55482] TERMCAP can break on systems that don't supp

From: Scott Shambarger
Subject: [screen-devel] [bug #55482] TERMCAP can break on systems that don't support terminfo
Date: Tue, 15 Jan 2019 17:33:21 -0500 (EST)
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:64.0) Gecko/20100101 Firefox/64.0


                 Summary: TERMCAP can break on systems that don't support
                 Project: GNU Screen
            Submitted by: sshambar
            Submitted on: Tue 15 Jan 2019 10:33:20 PM UTC
                Category: Program Logic
                Severity: 3 - Normal
                Priority: 5 - Normal
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 4.6.2
           Fixed Release: None
         Planned Release: None
           Work Required: None



I'm using TERM=xterm-256color on OSX, and the TERMCAP screen creates is too
large for the "compatibility" mode for many of the command line tools (such as
ls, man etc), eg error:

"TERMCAP", line 20, col 1, terminal 'SC': Missing separator
(ls output then shown)

I can create a ~/.terminfo entry (providing I use OSX /usr/bin/tic, not a
newer ncurses6 one), but it's clear the TERMCAP entry is not functioning --
the newer .terminfo entry also forces all my new apps to lose some
functionality (eg, color-pairs limited to 32767, since ncurses5 uses signed
short int)

man tic (and tic.h) declares 1023 as the maximum TERMCAP size (tic on 
GNU/Linux does the same), and the TERMCAP screen generates is much larger
(1325 in the case of screen.xterm-256color).

I worked a bit with the screen source, and figured that I could get the
TERMCAP to fit well if I excluded some extra keys (shifted function keys etc).
 In the process, I created a patch which limits TERMCAP_BUFSIZE to 1023 (it
can still be configured at build), and creates an "unwrapped" TERMCAP w/o the
vt220 extra keys (saving space), but still include the navigation keys etc. 
(if BUFSIZE is set larger, all keys are included).

I also have AddCap silently ignore any caps that push the TERMCAP past the
limit, rather than Panicing.

To support the termcap dump, I created a function DumpTermcap that writes a
wrapped/indented copy to the .termcap file.

I've tried this out, and it works great on my Mac, and still allows modern
apps (eg emacs) to use the full capabilities of ncurses6 terminfo.

I'll attach the patch.


File Attachments:

Date: Tue 15 Jan 2019 10:33:20 PM UTC  Name:
0001-Create-TERMCAP-entries-limited-to-1023-bytes-by-defa.patch  Size: 5KiB  
By: sshambar



Reply to this item at:


  Message sent via Savannah

reply via email to

[Prev in Thread] Current Thread [Next in Thread]