Commit Graph

871 Commits

Author SHA1 Message Date
Eric Mertens
36c1dcc451 Simplify definition of MaybeDefault
The previous version of MaybeDefault stores pointers to the Eq, Show, and Read instances of the defaulted value.

MaybeDefault is used with Style, Color, and Text. All of these types already have all of the necessary instances, and we never work with MaybeDefault generically. Defering the Show, Eq, and Read instances down to the SetTo case isn't helping us to work with types that don't have these instances.
2020-11-16 09:56:30 -08:00
Jonathan Daugherty
d470f5f9d4 Bump version, update changelog 2020-11-08 20:43:37 -08:00
Jonathan Daugherty
99d738b02c Add missing import 2020-11-08 20:43:06 -08:00
Jonathan Daugherty
fd8c4def96
Merge pull request #194 from emekoi/fix-utf8
Ensure detection of UTF-8 mode regardless of case
2020-11-08 20:39:29 -08:00
Emeka Nkurumeh
4aa1873485 follow up to #89 - ensure string are the same case 2020-11-08 22:37:12 -06:00
Jonathan Daugherty
0b4fa6410b Merge branch 'master' of github.com:jtdaugherty/vty into master 2020-11-04 18:11:48 -08:00
Jonathan Daugherty
27e9bf77a5 specialSupportKeys: add cases for Meta-PageUp and Meta-PageDown (fixes #193) 2020-11-04 18:11:43 -08:00
Jonathan Daugherty
ef6b73d71b supportsItalics, supportsStrikethrough: documentation 2020-10-13 08:57:43 -07:00
Jonathan Daugherty
bcbf7fabc1 Output: add supportsItalics and supportsStrikethrough to check for feature support 2020-10-13 08:52:18 -07:00
Jonathan Daugherty
63adf9e4db Bump version, update changelog 2020-09-30 15:44:46 -07:00
Jonathan Daugherty
1dc2379e3c Add support for strikethrough mode
This change adds a new 'strikethrough' Style value and uses the 'smxx'
and 'rmxx' Terminfo capabilities to activate and deactivate
strikethrough mode, respectively. If the terminfo does not report those
capabilities, this style is ignored.

For details, see

https://invisible-island.net/xterm/terminfo-contents.html#tic-ecma_strikeout
2020-09-30 12:45:58 -07:00
Jonathan Daugherty
90ea18379d
Merge pull request #189 from gdziadkiewicz/master
Update LICENSE file to make it recognizable by GitHub
2020-08-15 07:59:32 -07:00
Grzegorz Dziadkiewicz
da1d567668
Update LICENSE to make it recognizable by GitHub 2020-08-15 14:57:16 +02:00
Jonathan Daugherty
dea6fbfa98 XTermColor: remove unhelpful comment 2020-07-29 11:35:17 -07:00
Jonathan Daugherty
00b0cbcfa9 gwinsz.h: fix vty_c_get_window_size prototype 2020-07-15 13:50:31 -07:00
Jonathan Daugherty
2fabd997b6 Whitespace 2020-07-15 13:50:23 -07:00
Jonathan Daugherty
6a9c90da0e Output: add setDisplayBounds field and implementation for TerminfoBased backend 2020-07-15 13:49:05 -07:00
Jonathan Daugherty
5922c53459 Bump version, update changelog 2020-07-15 12:17:41 -07:00
Jonathan Daugherty
cb08446df4 Graphics.Vty: add setWindowTitle (fixes #188) 2020-07-15 10:42:29 -07:00
Jonathan Daugherty
95ea88c814 Bump version, update changelog 2020-07-09 15:17:22 -07:00
Jonathan Daugherty
a828f305d0 Merge branch 'bugfix/terminal-init-flags' 2020-07-09 15:05:20 -07:00
Jonathan Daugherty
812e873499 Input: add a new field, restoreInputState
This change adds a new record field to the Input type to allow the end
user to have direct access to the logic needed to restore the terminal's
input state flags. Prior to this change, this state restoration logic
could only be invoked as part of calling 'shutdownInput', but since that
function does other things (like killing threads) it is not advisable to
call it repeatedly (which is necessary in the use case this change is
intended to support).

This change supports a use case where an application initializes
Vty repeatedly, with changes to the input state flags in between
initializations, but where the application wants to ensure that the
*final* input state flag configuration matches the terminal's condition
before Vty started handling input for the first time. This change allows
applications to access the state restoration for the initial Vty handle
by exposing the logic directly in a field of Input.

The input state restoration is still an implicit part of invoking
'shutdownInput' (and thus 'shutdown') so no user-facing changes are
required for applications that do not build their own Input structures.
2020-07-09 15:01:45 -07:00
Jonathan Daugherty
e49ea78472 Whitespace 2020-07-09 14:14:17 -07:00
Jonathan Daugherty
be263d4893 Typo 2020-07-09 14:07:33 -07:00
Jonathan Daugherty
620a5ca544 attributeControl: document which constructors map to which terminal mode flags 2020-07-09 14:07:14 -07:00
Jonathan Daugherty
95cabe0b87 inputForConfig: move mode flag documentation to the right place and update it to include enabled flags 2020-07-09 14:05:45 -07:00
Jonathan Daugherty
c572ad1ac7 attributeControl: explicitly enable a required mode flag (see #187)
Prior to this change, Vty would initialize the terminal by clearing the
flags it needed to clear. That is good, but it means that some flags
that were assumed to be enabled but not *explicitly* enabled by Vty
would cause trouble if they were not, in fact, enabled prior to Vty
initialization.

This comes up in (pathological?) cases where the terminal state prior to
Vty initialization is not what Vty assumes it will be, i.e., cases in
which some flags which are assumed to be set are not. We found this to
be true when an application (in this case vim) was terminated uncleanly,
leaving the terminal mode flags in a state that Vty did not anticipate.

To resolve this problem, this change explicitly sets one flag which we
now know to be required for Vty to function properly (the ICRNL flag).
2020-07-09 13:57:33 -07:00
Jonathan Daugherty
17e2560846 Clarify the meaning of "escapes" in some Haddocks (fixes #186) 2020-05-02 15:53:44 -07:00
Jonathan Daugherty
f7eef975de Bump version, update changelog 2020-03-27 09:14:12 -07:00
Jonathan Daugherty
a0a32ec5fa Depend on semigroups for older GHCs (fixes #185) 2020-03-27 09:12:48 -07:00
Jonathan Daugherty
92590dead1 Bump version, update changelog 2020-03-09 15:37:46 -07:00
Jonathan Daugherty
ab10b97e31 Graphics.Vty.UnicodeWidthTable.Install: use withMVar to avoid boilerplate 2020-03-09 13:49:11 -07:00
Jonathan Daugherty
0d2226cb1a installUnicodeWidthTable: use throwIO, not throw 2020-03-09 13:45:05 -07:00
Jonathan Daugherty
9a9aeb65ea Bump version, update changelog 2020-03-09 13:40:14 -07:00
Jonathan Daugherty
c97c03718d Merge branch 'master' into feature/unicode-tables 2020-03-09 13:31:26 -07:00
Jonathan Daugherty
01e358b05f Revert "Travis: disable shared libraries in test build to address test linking failures"
This reverts commit 7255d692fa.
2020-03-09 12:54:57 -07:00
Jonathan Daugherty
7255d692fa Travis: disable shared libraries in test build to address test linking failures
This change is an attempt to address failures like the one at

https://travis-ci.org/jtdaugherty/vty/jobs/660259959

that give rise to the "Prelude.read: no parse" errors. Although that may
not seem like the error one would expect, see these resources for
details on why I think this is the "fix" for this problem:

* https://stackoverflow.com/questions/39310043/getting-prelude-read-no-parse-error-when-using-detailed-0-9-tests-with-cabal
* https://github.com/haskell/cabal/pull/3527
2020-03-09 10:50:19 -07:00
Jonathan Daugherty
84e391f56a UnicodeWidthTable.Install: clean up lock use 2020-03-09 10:24:57 -07:00
Jonathan Daugherty
5772d6aa57 UnicodeWidthTable.Install: make functions thread-safe with a global MVar 2020-03-09 10:20:28 -07:00
Jonathan Daugherty
a13f8fcb70 installUnicodeWidthTable: use custom exception type rather than calling "error" 2020-03-09 10:10:41 -07:00
Jonathan Daugherty
eabe52ba23 CHANGELOG: reformat 2020-03-06 11:04:46 -08:00
Jonathan Daugherty
18abb95ff4 BuildWidthTable: output nit 2020-03-06 10:20:48 -08:00
Jonathan Daugherty
261284cba7 BuildWidthTable: nits 2020-03-06 10:08:13 -08:00
Jonathan Daugherty
107be32423 BuildWidthTable: wait until the table is built before we create the output path 2020-03-06 09:35:33 -08:00
Jonathan Daugherty
b5b980c9e8 BuildWidthTable: cleanup 2020-03-06 09:34:55 -08:00
Jonathan Daugherty
63746c65e7 BuildWidthTable: add command-line flag to control which configuration file is updated 2020-03-06 09:33:57 -08:00
Jonathan Daugherty
c204e6dd21 BuildWidthTable: add command-line flag to update Vty config to use new map 2020-03-06 09:29:12 -08:00
Jonathan Daugherty
da8222347f Graphics.Vty.Config: add addConfigWidthMap 2020-03-06 09:29:07 -08:00
Jonathan Daugherty
d8cdb981e1 BuildWidthTable: create Vty configuration parent directories if necessary 2020-03-06 09:18:54 -08:00
Jonathan Daugherty
8c24083402 buildUnicodeWidthTable: docs update 2020-03-05 14:47:56 -08:00