termion merge requestshttps://gitlab.redox-os.org/redox-os/termion/-/merge_requests2024-03-22T18:36:25Zhttps://gitlab.redox-os.org/redox-os/termion/-/merge_requests/188Added Ctrl/Alt/Shift+Navigation key support.2024-03-22T18:36:25ZPaul FarielloAdded Ctrl/Alt/Shift+Navigation key support.Original MR: !175
Since, it has been dropped with 794ba8fc.Original MR: !175
Since, it has been dropped with 794ba8fc.https://gitlab.redox-os.org/redox-os/termion/-/merge_requests/187`IntoRawMode`: support arbitrary TTYs2024-01-06T10:33:41ZDenis Varlakov`IntoRawMode`: support arbitrary TTYsUpdates the `IntoRawMode` trait to support arbitrary TTYs (currently, only stdout is supported, see #197). Requires major version bump, although migration from the current version should be as smooth as possible.Updates the `IntoRawMode` trait to support arbitrary TTYs (currently, only stdout is supported, see #197). Requires major version bump, although migration from the current version should be as smooth as possible.https://gitlab.redox-os.org/redox-os/termion/-/merge_requests/186Use libredox ABI on Redox.2023-11-04T16:38:11ZJacob Lorentzon4ldo2@protonmail.comUse libredox ABI on Redox.https://gitlab.redox-os.org/redox-os/termion/-/merge_requests/185Use libredox ABI on Redox.2023-10-19T14:59:18ZJacob Lorentzon4ldo2@protonmail.comUse libredox ABI on Redox.https://gitlab.redox-os.org/redox-os/termion/-/merge_requests/184Use `format!` instead of numtoa and concat2024-01-25T16:09:50ZGary GuoUse `format!` instead of numtoa and concatThe use of `numtoa` is not necessary; it adds an extra dependency and extra binary size.
* `[..., numtoa, ...].concat()` is replaced with a `format!` -- allocation is necessary for concat anyway
* `From<...> for String` is replaced with...The use of `numtoa` is not necessary; it adds an extra dependency and extra binary size.
* `[..., numtoa, ...].concat()` is replaced with a `format!` -- allocation is necessary for concat anyway
* `From<...> for String` is replaced with the `to_string()` method to reuse the existing `Display` implhttps://gitlab.redox-os.org/redox-os/termion/-/merge_requests/183Update redox_syscall crate2023-11-04T16:40:16ZRibbonUpdate redox_syscall crateCheck if it build normally.Check if it build normally.https://gitlab.redox-os.org/redox-os/termion/-/merge_requests/182Add basic windows support.2023-07-06T23:50:15ZGints PolisAdd basic windows support.Merge & resolveMerge & resolvehttps://gitlab.redox-os.org/redox-os/termion/-/merge_requests/181Use libc to be more resilient and compatible.2021-09-27T22:20:18ZLuqman AdenUse libc to be more resilient and compatible.The first commit just switches to calling the functions defined in libc instead of trying to link against them directly. This fixes the first issue on some platforms like illumos/solaris where `cfmakeraw` isn't defined but libc includes ...The first commit just switches to calling the functions defined in libc instead of trying to link against them directly. This fixes the first issue on some platforms like illumos/solaris where `cfmakeraw` isn't defined but libc includes a [shim](https://github.com/rust-lang/libc/blob/dc343939e5e0c5a36e354e8eb808b4c2e0a80700/src/unix/solarish/compat.rs#L9-L32).
The second commit uses the constant `TCSANOW` instead of hardcoding it since it is 0 on Linux but not all other platforms. (Also use `STDOUT_FILENO` for consistency).
With these two fixes, cargo test passes for me without a linker error (first issue) or failing with invalid argument (second issue).https://gitlab.redox-os.org/redox-os/termion/-/merge_requests/180use raw identifier syntax for mod 'async' as it is a keyword since 2018 edition2021-09-14T20:32:28ZAndreas Blumuse raw identifier syntax for mod 'async' as it is a keyword since 2018 editionSince Rust edition 2018 async is a keyword and the rust-analyzer is not supporting rust 2015 edition where it was not a keyword yet, it erroneously causes misbehavior of the rust-analyzer.Since Rust edition 2018 async is a keyword and the rust-analyzer is not supporting rust 2015 edition where it was not a keyword yet, it erroneously causes misbehavior of the rust-analyzer.https://gitlab.redox-os.org/redox-os/termion/-/merge_requests/179Annotate the tuple returned by terminal_size()2022-10-21T06:47:14ZRich BAnnotate the tuple returned by terminal_size()Make clear that the tuple is (columns, rows).Make clear that the tuple is (columns, rows).https://gitlab.redox-os.org/redox-os/termion/-/merge_requests/178Improve error handling in the `raw` and `screen` modules2022-10-21T07:09:11ZLassi PulkkinenImprove error handling in the `raw` and `screen` modulesThe current implementations of `RawTerminal` and `AlternateScreen` handle I/O errors in `drop` by panicking. This MR changes this behavior to ignoring such errors instead. This is how similar cases are handled in the standard library (`F...The current implementations of `RawTerminal` and `AlternateScreen` handle I/O errors in `drop` by panicking. This MR changes this behavior to ignoring such errors instead. This is how similar cases are handled in the standard library (`File`, maybe others).
I also removed panicking from `AlternateScreen::from`. That API seemed a bit odd in general, so I used this opportunity to make it more consistent with that of the `raw` module by replacing said function with an `IntoAlternateScreen` trait.
And yes, this is definitely a breaking change, so the version number will need to be incremented to 2.0.0 if this gets merged.https://gitlab.redox-os.org/redox-os/termion/-/merge_requests/177Implement Display for event::Key2022-10-21T07:08:24ZBrooks RadyImplement Display for event::KeyThis is related to the effort in !176, but this time adds a display implementation for the keys. While this is certainly nice to have upstream, I'd understand if this change in particular is a little out of scope.
Would love to know wha...This is related to the effort in !176, but this time adds a display implementation for the keys. While this is certainly nice to have upstream, I'd understand if this change in particular is a little out of scope.
Would love to know what you think!https://gitlab.redox-os.org/redox-os/termion/-/merge_requests/1761.6.0 - add optional serde implementations2022-10-21T06:55:38ZBrooks Rady1.6.0 - add optional serde implementationsThe bytes to key parsing in Termion is super useful and something we need in [Zellij](https://github.com/zellij-org/zellij), but we also need to Serialise things occasionally!
Rust's orphan rule makes this a massive pain normally, so we...The bytes to key parsing in Termion is super useful and something we need in [Zellij](https://github.com/zellij-org/zellij), but we also need to Serialise things occasionally!
Rust's orphan rule makes this a massive pain normally, so we needed a fork to derive it.
This adds `Serialize` and `Deserialize` implementations to some input structs when the `serde` feature is enabled. It shouldn't have any affect at all when the feature is off (as is the default).https://gitlab.redox-os.org/redox-os/termion/-/merge_requests/175Added Ctrl/Alt/Shift+Navigation key support2024-03-20T16:10:23ZridcullyAdded Ctrl/Alt/Shift+Navigation key supportThis adds support for using Ctrl+Left, Alt+Right, Shift+Up, etc. keys on some terminals.
Fixes: #183 and #169This adds support for using Ctrl+Left, Alt+Right, Shift+Up, etc. keys on some terminals.
Fixes: #183 and #169https://gitlab.redox-os.org/redox-os/termion/-/merge_requests/174Add Windows 10 support2023-03-06T23:44:37ZkankriAdd Windows 10 supportI tried the merge request !151 but found it wasn't really working. This MR adds commits to that.
Running e.g. the `keys` example seemed to be somewhat working when started with `cargo run --example keys`, but wasn't working if started d...I tried the merge request !151 but found it wasn't really working. This MR adds commits to that.
Running e.g. the `keys` example seemed to be somewhat working when started with `cargo run --example keys`, but wasn't working if started directly as `target\debug\examples\keys.exe`: escape sequences were just printed on the screen instead of controlling the output. It seems `cargo` leaves the console in the Virtual Terminal mode, thus hiding the fact that `termion` didn't properly set up the console. Even when started from `cargo`, keyboard input was not handled properly.
I fixed the problems I noticed in the original MR:
* Fix unused imports.
* Fix "termion::sys::tty::is_tty()".
* Add support for using escape sequences and reading special keys on Windows 10.
Then I changed some of the examples to make it easier to test the various features:
* Print keys using Debug trait in examples/keys.rs.
* Show more color and style features in examples/color.rs.
* Print mouse events in examples/mouse.rs.
Finally I added some tests for `parse_csi()` and fixed the panics those tests discovered:
* Fix a comment.
* Normalize indentation in "event::parse_csi()".
* Simplify pattern matching in "event::parse_csi()".
* Simplify pattern matching in "event::parse_csi()" with "ok()?".
* Add tests for "CSI <" and fix "event::parse_csi()" not to panic.
* Add tests for "CSI M" and fix "event::parse_csi()" not to panic.
* Fix invalid tests.
* Simplify matching "CSI M" in "event::parse_csi()".
* Add tests for "CSI ... M" and fix "event::parse_csi()" not to panic.
* Add tests for "CSI ... ~" and fix "event::parse_csi()" not to panic.
There are still some shortcomings in Windows support:
* Control-j, control-m and Enter are all reported as `Char('\n')`
* Control-z ends the input iterator (because of [CTRL_Z_MASK in `std::sys::windows::stdio::read_u16s()`](https://github.com/rust-lang/rust/blob/4a00421ba4daae419d06b67bd1bb46d7930b0dc7/library/std/src/sys/windows/stdio.rs#L206))
* Control-arrow keys are not supported (`termion` doesn't parse multiple arguments)
* Window resize events are not received
* Only Windows 10.0.10586 and later is supported (some features starting from 10.0.14393)
All of these problems could be avoided by using the Windows Console API to get key and windows size events directly.https://gitlab.redox-os.org/redox-os/termion/-/merge_requests/173Fix "red" color in example simple.rs2022-10-21T06:49:12ZPeter RoehlenFix "red" color in example simple.rsThe `simple` example has a typo. When the user presses `r` the color is supposed to change to red however the RGB value being set in the code is almost black and the output is not visible on dark terminal backgrounds.The `simple` example has a typo. When the user presses `r` the color is supposed to change to red however the RGB value being set in the code is almost black and the output is not visible on dark terminal backgrounds.https://gitlab.redox-os.org/redox-os/termion/-/merge_requests/172Added AsRawFd impl to MouseTerminal2022-10-21T06:50:35ZBen GoldbergAdded AsRawFd impl to MouseTerminalThis is needed for use with smol.This is needed for use with smol.https://gitlab.redox-os.org/redox-os/termion/-/merge_requests/171Rust 2018 conversion2023-03-06T23:54:01ZBen GoldbergRust 2018 conversionI've converted termion to rust 2018 edition. I've tried to make minimal changes to the code, just making it compile without warnings.
I've done this because I plan to add (optional) async support for a project of mine and async syntax r...I've converted termion to rust 2018 edition. I've tried to make minimal changes to the code, just making it compile without warnings.
I've done this because I plan to add (optional) async support for a project of mine and async syntax requires 2018 edition.https://gitlab.redox-os.org/redox-os/termion/-/merge_requests/170Added AsRawFd impl for RawTerminal2020-06-26T12:20:28ZBen GoldbergAdded AsRawFd impl for RawTerminalThis is impl is needed in certain cases. I need it to used termion with [`smol::Async`](https://docs.rs/smol/0.1.18/smol/struct.Async.html).This is impl is needed in certain cases. I need it to used termion with [`smol::Async`](https://docs.rs/smol/0.1.18/smol/struct.Async.html).https://gitlab.redox-os.org/redox-os/termion/-/merge_requests/169tweak description of terminal_size_pixels() to fit in with the rest2022-10-21T06:52:07Zrabite0tweak description of terminal_size_pixels() to fit in with the restIt kind of sticks out in the docs like I sore thumb, so I went ahead and adjusted the text slightly to match the writing style of the other descriptions. Nothing else was changed.It kind of sticks out in the docs like I sore thumb, so I went ahead and adjusted the text slightly to match the writing style of the other descriptions. Nothing else was changed.