bugGNU Screen - Bugs: bug #55482, TERMCAP can break on systems that...

 
 

bug #55482: TERMCAP can break on systems that don't support terminfo

Submitted by:  Scott Shambarger <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 Release:  4.6.2
Fixed Release:  None Planned Release:  None
Work Required:  None

Add a New Comment (Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Tue 15 Jan 2019 10:33:20 PM UTC, original submission:  

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.

Scott Shambarger <sshambar>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by sshambar (Submitted the item)
  • -email is unavailable- added by sshambar
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

     

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-01-15 sshambar Attached File- => Added 0001-Create-TERMCAP-entries-limited-to-1023-bytes-by-defa.patch, #45981
        Carbon-Copy- => Added sshambar

    Back to the top


    Powered by Savane 3.5