-
Notifications
You must be signed in to change notification settings - Fork 300
Upgrade from 0.13 to 0.14
Timon edited this page Nov 16, 2019
·
19 revisions
- Removed
cursor
,style
,terminal
andscreen
feature flags- All the functionality is included by default and there's no way how to disable it.
- Removed
input
feature flag - New feature flag
event
- Enables
event
module and allows you to handle events like key input, mouse input, and terminal resize.
- Enables
- New feature flag
async-event
- Auto enables
event
feature and providesEventStream
(futures::Stream
) on top of theevent
module that can be used for asynchronous event reading.
- Auto enables
- The previous features flags were getting unmanageable
- Death code is getting compiled away anyways
- Other modules than the
event
module, is not depending on lots of external code, that is why we chose to keep theevent
flag and remove the other ones. - Crossterm has shrunk a few thousand lines of code since the feature flags were introduced.
- Easier development on our side.
Why did we keep event
(old input flag) and introduced async-event
?
- The
event
module brings some additional dependencies likebitflags
,parking_lot
andmio
, and the most used module. That is styling. - The
async-event
feature is introduced because not everyone wants to use async stuff and it also brings in thefutures
crate dependency.
The whole input
module was removed. To be more precise, replaced with the brand new
event
module with lots of new features.
New Features
- Terminal Resize Events
- Advanced Modifier (ALT, SHIFT, CTRL) support, for both key and mouse buttons.
- Less resource-consuming event handling on windows (WaitForMultipleObjects) and UNIX (MIO). No more spinning loop and threading work.
- Async environment support.
- Simplistic API
poll(Duration)
andread
.