screen-devel
[Top][All Lists]
Advanced

[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

URL:
  <https://savannah.gnu.org/bugs/?55482>

                 Summary: TERMCAP can break on systems that don't support
terminfo
                 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

    _______________________________________________________

Details:

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:

/bin/ls
"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

<http://savannah.gnu.org/bugs/download.php?file_id=45981>

    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?55482>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

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