Commit Graph

32 Commits

Author SHA1 Message Date
Lassi Pulkkinen 5d08b65b57
Improve error handling in the `raw` and `screen` modules
- Ignore errors in `Drop` implementations.
- Replace `AlternateScreen::from` with an `IntoAlternateScreen` trait
  which doesn't panic on errors, to make the API more consistent with
  the `raw` module.
2021-06-09 00:28:24 +03:00
zethra c471ab6811 Added AsRawFd impl for RawTerminal 2020-06-26 03:31:48 -04:00
Jeremy Soller a448f510f0
1.5.5 - fix warnings 2020-01-20 11:12:03 -07:00
Nathan Lilienthal b64b10f40b Add ability to suspend/activate raw mode on RawTerminal 2018-10-12 01:40:18 -04:00
Jeremy Soller cd455e8358 Move system specific features into sys module 2017-07-31 21:17:47 -06:00
Jeremy Soller 75b28bab55 Fix raw mode on Redox 2017-06-08 18:47:12 -06:00
ticki 15c65dc5f9
Run rustfmt on the code. 2017-03-24 21:53:05 +01:00
IGI-111 0758c07ab7 added cursor position detection
This solves #85 in a similar fashion as the color amount detection: the
cursor module now provides a trait that adds a `cursor_pos()` method to
an instance of `Write`. It also corrects that previous implementation
somewhat by making the `CONTROL_SEQUENCE_TIMEOUT` a member of the raw
module and implementing `DetectColors` for any instance of `Write`
rather than just `RawTerminal` (`MouseTerminal` for instance works as
well).
2017-03-12 20:18:32 +00: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
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 e63b645859 Update the documentation. 2016-09-07 11:39:32 +02:00
llogiq 21716b2f93 fixed a few clippy warnings (#44) 2016-08-04 22:37:03 +02:00
Jeremy Soller fae35e2ea1 Fix RawTerminal drop 2016-07-24 07:07:21 -06:00
ticki 25c7cd8635 Fix Redox raw mode 2016-07-23 22:06:17 +02:00
ticki 9bd833a663 Fix the tests 2016-07-23 20:41:43 +02:00
ticki 5b94db9663 Merge 2016-07-23 17:49:52 +02:00
ticki e36ff1c71b Termion 1.0.0: Complete overhaul of how escape codes are handled, add truecolor support.
This commit is a major semver bump. Every progra utilizing escape codes generated by Termion is likely broken. The main change is to make each escape has their own type implementing the Display trait.

- Use formatters, mainly Display for escapes.

- Add Truecolor support (`color::Rgb`).

- Put each primitive into distinct modules.

- Add is_tty for checking if some stream is a TTY.

- Add multiple new examples.
2016-07-23 16:40:27 +02:00
IGI-111 1c50a795f8 added some tests 2016-07-20 13:06:04 +02:00
IGI-111 ab12a8f8a6 fixed formatting 2016-07-20 11:03:30 +02:00
IGI-111 206c61de9e made mouse optional and fixed small issues 2016-07-20 01:13:03 +02:00
IGI-111 cc9c32b981 added mouse input
The event system has been reworked to allow the detection of mouse
events as well as key presses.
Xterm, rxvt and X10 emulated escape codes are supported, they are
enabled and disabled by sending the right escape codes when creating a
RawTerminal.

To allow for byte manipulation, which was necessary to implement those
features, the backend iterator has been changed from chars() to bytes()
(with specific treatment of unicode sequences), making the whole crate
not require nightly rustc.
2016-07-19 18:17:12 +02:00
ticki 8bcb946b07 Update readme 2016-06-14 14:29:31 +02:00
ticki 11225e561d Fix #24, make use of Result instead 2016-06-14 14:24:07 +02:00
Ticki 7da5fbf36f Clean up imports in raw module 2016-03-20 22:55:08 +01:00
Jeremy Soller 72f87e0176 Fix redox support 2016-03-16 12:59:12 -06:00
Ticki 32d8ccfa24 Use IO error, instead of a custom one 2016-03-13 11:55:24 +01:00
Ticki 2335596a1a TerminalRestorer -> RawTerminal 2016-03-10 16:24:41 +01:00
Ticki 5d4826d4ff Add test to _everything_ 2016-03-09 17:18:31 +01:00
Ticki 6f1621d2d0 Introduce 'Key', which can decode special key input 2016-03-09 09:39:22 +01:00
Ticki 0fde52e3f9 Fixes for Redox 2016-03-07 22:22:25 +01:00
Ticki fd2d74d41a Now supports Redox! 2016-03-07 22:19:35 +01:00
Ticki c89a8f7027 Restructuring and error handling 2016-03-07 16:01:20 +01:00