Commit Graph

250 Commits

Author SHA1 Message Date
ftilde 95233e9e5c Add support for alternate screen (#88)
* Add (optional) support for alternate screen (#77)

The user can manually switch between main and alternate screen or
(preferably) use the wrapper struct for automatic screen restoration.

* Add two examples for screen switching

* Improve screen module documentation
2017-02-27 13:42:55 +01:00
ticki c676cb43e7 Bump to 1.2.0. 2017-02-26 09:37:35 +01:00
IGI-111 ba72d0bcec Added color support detection (#91)
* Added color support detection

Color support is inferred by using either OSC 4 escape codes or the
value of TERM.

* minor refactor and cosmetic changes
2017-02-26 09:35:39 +01:00
Loïc Damien 23ef0260dd Fix 64 bit build for musl and android (#90) 2017-02-25 20:17:54 +01:00
Alexandre Bury 04f6bcd677 Remove vertical spacing from Readme 2017-01-13 14:19:47 -08:00
Alexandre Bury c9c91292e5 Replace most `std::io::Write::write` with `write_all` (#82)
`std::io::Write` doesn't guarantees that it will write everything,
and could even return a non-fatal `ErrorKind::Interrupted` error.
`write_all` has exactly the code required to deal with this.
2016-12-21 14:20:48 +01:00
ticki c04fd7f263 Optimize SVG.
thx svgo
2016-12-19 19:56:49 +01:00
ticki 38fbf1200e Remove the excessive '['. 2016-12-19 17:39:41 +01:00
ticki 66603eead6 Move the badges outside the table. 2016-12-19 17:39:05 +01:00
ticki 064cfdd5f1 Correct the link. 2016-12-19 17:35:14 +01:00
ticki 461ed46ae0 Fix the Markdown syntax in the README. 2016-12-19 17:34:09 +01:00
ticki dda2b18386 Introducing the Termion logo. 2016-12-19 17:33:09 +01:00
Alexandre Bury 92cbd50c41 Fix typo in Readme 2016-12-19 16:59:28 +01:00
Alexandre Bury de016ae6ce Add travis & crates.io badges
Shamelessly copying Serde's style
2016-12-19 16:51:48 +01:00
Alexandre Bury 0395780f25 Add travis integration (#81)
* Add travis integration

* Update examples/rainbow to work on stable
2016-12-19 16:45:11 +01:00
Alexandre Bury 32ff8ba96e Replace UnknownCsi with generalized Event::Unsupported (#80) 2016-12-19 16:40:44 +01:00
ticki f9eaf6d0bc Merge branch 'master' of github.com:Ticki/libterm 2016-12-18 19:29:18 +01:00
ticki 7047acbabf Add `Color` implementation for `&Color`
Fix #53
2016-12-18 19:28:25 +01:00
Alexandre Bury c2df3d7edd Discard leftover input when consumed (#76)
* Discard leftover input when consumed

The iterator given to `parse_event` now `take()` the value from
`leftover`.

* Always save leftover

`parse_event` will consume it when required.

* Remove OptionIterator, directly uses std::option::Iter
2016-12-18 00:49:40 +01:00
Alexandre Bury 00ca758d45 Add `UnknownCSI` event type (#73)
* Add `UnknownCSI` event type.

* Compile test from `raw` module

But don't run it.

* Fix unused import warning in doc-test

* Rename UnknownCSI -> UnknownCsi
2016-12-16 18:20:17 +01:00
ticki e67128f795 Fix wrapping width. 2016-11-10 09:25:20 +01:00
ticki 56b3deaf27 Merge branch 'master' of github.com:Ticki/libterm 2016-11-08 08:44:13 +01:00
ticki be5fcb1f4f Add link to tutorial in README. 2016-11-08 08:43:51 +01:00
Felix Obenhuber dd3df793dc Fixed build for android targets (#72)
Bionic needs signed ioctrl arguments.
2016-11-06 20:29:39 +01:00
ticki 1d63c9cd28 Bump to next version. 2016-11-06 10:35:13 +01:00
ticki 2f008188e3 Add @gycos to the author list. 2016-11-06 10:26:45 +01:00
Alexandre Bury 8c82c461f9 Handles CSI `~` sequences with multiple values (#70)
* Handles CSI `~` sequences with multiple values

Fixes #62

* Fix doc typo
2016-11-06 10:23:02 +01:00
Alexandre Bury 786001f095 Fix CSI sequence detection (#69)
Properly detects CSI sequence termination.

Fixes #47, #68.
2016-11-06 10:22:12 +01:00
ticki f49a6e501b Merge branch 'master' of github.com:Ticki/libterm 2016-11-02 18:47:37 +01:00
ticki a3ad019010 Yes.
No.
2016-11-02 18:47:24 +01:00
ticki bb8d1704cd Revert "True terminal restoration" (#67) 2016-10-27 22:09:41 +02:00
IGI-111 0e0b5be856 Added true terminal restoration (#66)
Using the "alternate screen" capability, the RawTerminal trait restores
the terminal in its previous state by sending the proper escape codes.
2016-10-27 22:03:29 +02:00
Alexandre Bury 09d31132e2 Protects AsyncReader::read against empty buffer. (#65)
Move the check to the beginning of the loop to protect against empty buffer.
2016-10-27 22:02:29 +02:00
ticki 2d625d8c57 Bump version. 2016-10-26 11:58:03 +02:00
ticki 936c4336ce Merge branch 'master' of github.com:Ticki/libterm 2016-10-26 11:56:00 +02:00
ticki 8ccc67cf33 Update the mouse example.
We use click and drag.
2016-10-26 11:55:47 +02:00
Matthew Nicholson ea06c6fd56 Modify Keys and Events to detect Esc key presses (#45)
* modify Keys and Events to detect Esc key presses

The strategy used here is to read two bytes at a time, going on the
assumption that escape sequences will consist of multi byte reads and
solitary Esc key presses will consist of single byte reads.

Tests had to be modified to account for these new multi byte reads by
including dummy bytes when a single byte was previously expected.

Fixes ticki/termion#43

* expand keys example to include Esc key presses

* add test for Esc key press
2016-10-26 11:53:36 +02:00
Jordan MacDonald 654db645cb Derive PartialEq for Rgb type (#56) 2016-10-22 08:40:06 +02:00
David Irvine 5085815f58 bug/lib.rs Allow musl builds (#58) 2016-10-20 14:28:34 +02:00
Alexandre Bury 4358ed6c48 Derive Copy for color::{Rgb, Fg, Bg, Reset} (#54) 2016-10-09 07:13:41 +02:00
j-browne 0b24a3446d Change is_tty example to conform to new signature (#52)
Commit 0d1025c532 changed the signature of
is_tty, but the example was not updated.
2016-10-07 07:43:10 +02:00
Esption a0751f21b0 Add Debug to color structs and Clone to Rgb / Fg / Bg (#51) 2016-10-03 07:15:12 +02:00
ticki 44c847924c Add good documentation to the list of 'features'. 2016-10-02 22:35:21 +02:00
ticki e30add91e0 Specify that Termion is stable. 2016-10-02 22:33:06 +02:00
ticki f2cec304e8 Default to the TTY device in async_stdin. 2016-09-24 20:04:46 +02:00
ticki 0d1025c532 Take a reference to the stream instead of the stream itself (in `is_tty` 2016-09-24 19:13:16 +02:00
ticki e63b645859 Update the documentation. 2016-09-07 11:39:32 +02:00
ticki 5fa6289df8 Update the README.
Fix the documentation link and format it better.
2016-09-07 11:14:22 +02:00
ticki 2ff0916514 Bump to 1.0.7. 2016-09-07 11:09:48 +02:00
IGI-111 5ebda9866f added mouse hold support (#48)
This adds support for the escape codes generated in rxvt and xterm
format by holding a button and moving the mouse around.
2016-09-07 11:05:41 +02:00