Opened 7 years ago

Closed 6 years ago

#9293 closed enhancement (fixed)

Some Terminal enhancements

Reported by: Ziusudra Owned by: siarzhuk
Priority: normal Milestone: R1
Component: Applications/Terminal Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Has a Patch: yes Platform: All

Description

These fix most of the issues that I described over at HaikuPorts.

Patch 0001 adds a haiku termcap entry that accurately describes Terminal's current capabilities. This would fix #6424. (Issues such as #3164 and #6510 will probably be made worse unless the haiku termcap entry is installed on the remote or TERM is changed.)

Patch 0002 updates the master termcap.src. It also disables warnings in our ncurses.a; this is temporary. I'll be looking at better use of that termcap.src after the holidays.

Patch 0003 is just a style cleanup of TermParse.cpp.

Patch 0004 adds comments describing Terminal's terminfo/termcap capabilities.

Patch 0005 implements the other ACS characters that DejaVu has glyphs for.

Patch 0006 makes SGR codes 39 & 49 actually reset the color as IS_FORESET & IS_BACKSET are never used. Are they left over from something that got removed, or are they something that didn't get finished?

Patch 0007 fixes a bug I noticed while testing where SIGWINCH was not getting updated when the terminal size was changed by the Settings->Window size menu.

Patch 0008 just removes a few lines of duplicated code in TermView::AttachedToWindow.

Patch 0009 removes the SIGWINCH message, runner, handler and flag as they weren't used/needed.

There are still things I'm looking into. The already mentioned termcap.src, a terminfo entry (maybe eventually upstreamed to ncurses), cursor visibility, updating (or maybe removing) the in trunk ncurses, and maybe back color erase.

Attachments (11)

0001-Add-a-Haiku-termcap-entry.patch (3.4 KB ) - added by Ziusudra 7 years ago.
0002-Update-master-termcap-and-silence-ncurses-warnings.patch (2.7 MB ) - added by Ziusudra 7 years ago.
0003-Style-cleanup-no-functional-change-intended.patch (8.1 KB ) - added by Ziusudra 7 years ago.
0004-Added-comments-documenting-terminfo-termcap-capabili.patch (18.9 KB ) - added by Ziusudra 7 years ago.
0005-Added-other-ACS-characters-for-which-the-DejaVu-font.patch (6.4 KB ) - added by Ziusudra 7 years ago.
0006-Made-SGR-39-49-actually-reset-the-the-color.patch (1.0 KB ) - added by Ziusudra 7 years ago.
0007-Update-SIGWINCH-when-setting-terminal-size.patch (1.1 KB ) - added by Ziusudra 7 years ago.
0008-Fixed-a-bit-of-code-duplication.patch (962 bytes ) - added by Ziusudra 7 years ago.
0009-Removed-unused-message-and-runner-and-related-code.patch (3.9 KB ) - added by Ziusudra 7 years ago.
haiku-xterm-diff (2.8 KB ) - added by Ziusudra 7 years ago.
Shows the differences between Terminal and xterm capabilities
0010-Implemented-SGR-codes-for-setting-colors-8-15.patch (1.3 KB ) - added by Ziusudra 7 years ago.
This is something xterm does and includes in it's (recent) terminfo/termcap entry.

Change History (19)

by Ziusudra, 7 years ago

comment:1 by Ziusudra, 7 years ago

Has a Patch: set

in reply to:  1 comment:2 by siarzhuk, 7 years ago

Owner: changed from jackburton to siarzhuk
Status: newassigned

Replying to Ziusudra:

Thank you for this batch of changes!

Patch 0001 adds a haiku termcap entry that accurately describes Terminal's current capabilities.

In the early days of Haiku we have already "beterm" termcap entry inherited from BeOS. I suspect nobody will happy switching back to something non-standard. Our intention is to bring the Terminal to support standard capabilites instead of adjusting environment to it's imprefections. But anyway I found your investigations very usefull!

comment:3 by Ziusudra, 7 years ago

Standard? What standard? There is no standard.

xterm? The "xterm" in the termcap currently in trunk does not match the terminfo that comes with a full ncurses install (or the one in the new termcap).

I'll attach a file showing the differences in Terminal and the terminfo xterm capabilities. There's a lot of work to do.

Nothing stops the user from changing their TERM variable. But not having a Haiku termcap prevents them from being able to set TERM something that isn't going to cause issues of some sort.

If Terminal ever gets to the point that it can do everything some other termcap/terminfo entry can do then we can get rid of the haiku termcap.

Until then there's really nothing to lose by having it and we gain the ability to have programs behave as expected.

by Ziusudra, 7 years ago

Attachment: haiku-xterm-diff added

Shows the differences between Terminal and xterm capabilities

in reply to:  3 comment:4 by siarzhuk, 7 years ago

Replying to Ziusudra:

Standard? What standard? There is no standard.

xterm? The "xterm" in the termcap currently in trunk does not match the terminfo that comes with a full ncurses install (or the one in the new termcap).

Yes, the termcap should be synchronized with most actual and most widely used at the moment version. That is was I meant as "standard".

I'll attach a file showing the differences in Terminal and the terminfo xterm capabilities. There's a lot of work to do.

Unfortunately, thti is the only right way, in my opinion. :-|

comment:5 by Ziusudra, 7 years ago

Oh, absolutely, that is the way to go. It is going to take work and time. Until then having termcap and ncurses programs behave more correctly is possible.

Another benefit of maintaining a haiku termcap/terminfo entry is that that makes it easy to compare with xterm one and see what still needs to be done.

by Ziusudra, 7 years ago

This is something xterm does and includes in it's (recent) terminfo/termcap entry.

comment:6 by Ziusudra, 7 years ago

Added another patch.

Also, I did Patch 2 wrong, should have used tic -aCrTtx with the T option to prevent tic from limiting the size of the entries. Edit: will redo when I get back home in early January.

Last edited 7 years ago by Ziusudra (previous) (diff)

in reply to:  description comment:7 by siarzhuk, 6 years ago

Replying to Ziusudra:

Patch 0001 adds a haiku termcap entry that accurately describes Terminal's current capabilities.


I have rejected it. Terminal must be improved (see hrev45364 for example) to mimic xterm-256color more accurately instead of introducing another bit of Chaos in This World. ;-)

Patch 0002 updates the master termcap.src. It also disables warnings in our ncurses.a;


hrev45364 do something like this. Thank you for for some hints I have used improving my version of termcap.src.

Patch 0003 is just a style cleanup of TermParse.cpp.


obsoleted by hrev45364. Cleanup was performed on top of those changes anyway.

Patch 0004 adds comments describing Terminal's terminfo/termcap capabilities.


I hope we switch to terminfo soon, so there no need to overload code with such info, IMO.

Patch 0005 implements the other ACS characters that DejaVu has glyphs for.


Partially applied in hrev45367. Thank you for the contribution!

Patch 0006 makes SGR codes 39 & 49 actually reset the color as IS_FORESET & IS_BACKSET are never used. Are they left over from something that got removed, or are they something that didn't get finished?


Obsoleted by hrev45364.

Patch 0008 just removes a few lines of duplicated code in TermView::AttachedToWindow.


Applied in hrev45367. Thank you for the contribution!

Patch 0007 fixes a bug I noticed while testing where SIGWINCH was not getting updated when the terminal size was changed by the Settings->Window size menu. Patch 0009 removes the SIGWINCH message, runner, handler and flag as they weren't used/needed.


I'm investigating the SIGWINCH handling now. IMO replacing BMessageRunner-driven handler with direct call of corresponding handler is not equal and not safe. It changes the processing context and may have unpleasant side-effects and regressions.
Thank you for your work anyway!

comment:8 by siarzhuk, 6 years ago

Resolution: fixed
Status: assignedclosed

The SIGWINCH problem you have pointed is fixed in hrev45379. Thank you.

Note: See TracTickets for help on using tickets.