After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 169295 - builtin termcap parser not needed
builtin termcap parser not needed
Status: RESOLVED FIXED
Product: vte
Classification: Core
Component: general
unspecified
Other Linux
: Normal enhancement
: ---
Assigned To: VTE Maintainers
VTE Maintainers
: 532897 569627 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2005-03-05 14:42 UTC by Roman Kagan
Modified: 2014-04-23 18:12 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Replace builtin termcap parser with library calls (12.74 KB, patch)
2005-03-05 14:46 UTC, Roman Kagan
none Details | Review
Patch updated to apply against svn head (26.73 KB, patch)
2007-05-05 02:07 UTC, James Bowes
none Details | Review
Recognize 'Return' key (29.74 KB, patch)
2007-05-08 12:14 UTC, James Bowes
none Details | Review

Description Roman Kagan 2005-03-05 14:42:38 UTC
The termcap parser doesn't have to live in vte.  All the functionality is
provided in a termcap or curses library vte depends upon anyway.
Besides, it necessiates maintaining an up-to-date termcap file even for
terminfo-only systems.
Comment 1 Roman Kagan 2005-03-05 14:46:57 UTC
Created attachment 38299 [details] [review]
Replace builtin termcap parser with library calls

This proof-of-the-concept patch removes the builtin termcap parser with the
calls to standard libtermcap functions.

Applies to 0.11.1x.  Tested for many months with ncurses.
Comment 2 Kjartan Maraas 2005-05-11 12:03:23 UTC
Has it been tested on different distros and platforms? I have the impression
that the termcap database has been an area where many people disagree how it
should behave...
Comment 3 Roman Kagan 2005-05-11 19:45:43 UTC
> Has it been tested on different distros and platforms?

No I didn't have the facilities to do so (nor the motivation :)

> I have the impression that the termcap database has been an area where many
people disagree how it should behave...

At any rate there seems to be no reason to use a terminal capability library in
some parts of the code, and the internal termcap parser in some other.  With the
patch, it's up to the packager which particular termlib implementation is to be
used (termcap, ncurses, etc.) - it'll be used consistently everywhere.

BTW the patch needs an update to the latest vte version and a whitespace
cleanup; if there's any interest I can do it.
Comment 4 Behdad Esfahbod 2006-03-31 04:05:19 UTC
Like the idea.  Roman, can you submit an updated final patch?  Or does it need more work?
Comment 5 Roman Kagan 2006-04-03 16:09:39 UTC
It certainly does.  I'll try to find some time this week to beat it into shape.
Comment 6 Allison Karlitskaya (desrt) 2006-09-18 19:25:16 UTC
Roman: ping.
Comment 7 James Bowes 2007-05-05 02:07:48 UTC
Created attachment 87581 [details] [review]
Patch updated to apply against svn head

Is there still an interest in this bug? I figured I'd update it, since the original submitter seems absent.
Comment 8 James Bowes 2007-05-08 12:14:23 UTC
Created attachment 87802 [details] [review]
Recognize 'Return' key
Comment 9 Behdad Esfahbod 2007-11-28 13:07:40 UTC
Ryan, do you have comments on this?  I remember you hacking on it.  Can't remember what happened to your work.
Comment 10 Allison Karlitskaya (desrt) 2007-11-28 14:34:26 UTC
i believe our thinking at the time was that it would be better to rewrite the bad parser to not be so bad rather than replace it outright with a library call because we were afraid that the library call would end up causing all sorts of shifts in functionality that people would complain about

Comment 11 Roman Kagan 2007-11-30 00:29:28 UTC
(In reply to comment #10)
> i believe our thinking at the time was that it would be better to rewrite the
> bad parser to not be so bad

The problem is not in the quality of the parser, but rather in the quality and availablility of the data fed to it.  E.g. on Fedora 8 all terminal-aware stuff is linked against ncurses or slang; both use the terminfo database.  So /etc/termcap may be out of sync with the data used by apps running in the terminal, or may simply be missing.

> because we were afraid that the library call would end up causing all sorts of
> shifts in functionality that people would complain about

Fair enough.  OTOH note that these calls (as well as the original parser) are only used to populate the lookup tables, so it should be easy to check for regressions: one can take known-matching termcap and terminfo records, and feed them to the respective versions of the standalone lookup table dumper for comparison.
Comment 12 Allison Karlitskaya (desrt) 2007-11-30 00:36:29 UTC
actually, the quality of the parser was quite bad.  it had serious performance issues.  the "rewrite" that i refer to is the one that was done (and committed) a while ago (bug 354061).

if you have some time to show that the data read from terminfo is the same as the one from the termcap that we currently ship with gnome-terminal it would be very useful.  should probably consider that terminfo might give different results on different systems.

if you have a test program i can run, i'll do it on my ubuntu boxes :)
Comment 13 Behdad Esfahbod 2011-02-04 20:07:58 UTC
Lets look into this again.  This has the potential to fix all kind of arrow keys, function keys, etc bugs...
Comment 14 Christian Persch 2011-05-24 12:53:38 UTC
I've looked a bit into using terminfo in vte.

Using the ncurses terminfo doesn't look like a good match right now. We need to have per-VteTerminal terminfo, so we'd use newterm() and tiget*_sp(). However new_term takes a FD, and may read/write to that later, which would interfere with our code. Also, the *_sp functions apparently aren't enabled by default (at least here on my F13 libncurses doesn't have them).

What we really want is to just use the terminfo database, not all the handling that ncurses does around it. So either write a terminfo database reader ourself (using code adapted from ncurses), or work with ncurses upstream to export some functions to create an object for a given terminfo entry, and add tiget* variants that take that.

(Just FYI, if you're looking for a ncurses git, it's at git://ncurses.scripts.mit.edu/ncurses.git ).
Comment 15 Christian Persch 2014-04-21 20:29:32 UTC
Turned out to be easier than I thought. Pushed to wip/terminfo branch, which I'll merge in a few days if no issues pop up.
Comment 16 Christian Persch 2014-04-22 16:28:43 UTC
*** Bug 569627 has been marked as a duplicate of this bug. ***
Comment 17 Christian Persch 2014-04-22 16:53:59 UTC
*** Bug 532897 has been marked as a duplicate of this bug. ***
Comment 18 Christian Persch 2014-04-23 18:12:47 UTC
Let's try it on master.