Debian Codegraph @

CHANGELOG.md

raw
1 # Unreleased
2
3 # Version 0.29
4
5 ## Added ⭐
6
7 - Copy to clipboard using OSC52 (#974)
8 - Derive standard traits for "SetCursorStyle" (#909)
9 - Add query_keyboard_enhancement_flags to read enabled flags (#958)
10 - Add is_* and as_* methods to the event enums (#949)
11 - Add a feature flag for derive_more impls (#970)
12 - Update rustix to 1.0 (#982)
13
14 ## Breaking ⚠️
15
16 - Correctly fix KeyModifiers Display impl Properly adding + in between modifiers (#979)
17
18
19 # Version 0.28.1
20
21 ## Fixed 🐛
22
23 - Fix broken build on linux when using `use-dev-tty` with (#906)
24
25 ## Breaking ⚠️
26
27 - Fix desync with mio and signalhook between repo and published crate. (upgrade to mio 1.0)
28
29 # Version 0.28
30
31 ## Added ⭐
32
33 - Capture double click mouse events on windows (#826)
34 - (De)serialize Reset color (#824)
35 - Add functions to allow constructing `Attributes` in a const context (#817)
36 - Implement `Display` for `KeyCode` and `KeyModifiers` (#862)
37
38 ## Changed ⚙️
39
40 - Use Rustix by default instead of libc. Libc can be re-enabled if necessary with the `libc` feature flag (#892)
41 - `FileDesc` now requires a lifetime annotation.
42 - Improve available color detection (#885)
43 - Speed up `SetColors` by ~15-25% (#879)
44 - Remove unsafe and unnecessary size argument from `FileDesc::read()` (#821)
45
46 ## Breaking ⚠️
47
48 - Fix duplicate bit masks for caps lock and num lock (#863).
49 This breaks serialization of `KeyEventState`
50
51 # Version 0.27.1
52
53 ## Added ⭐
54 - Add support for (de)serializing `Reset` `Color`
55
56 # Version 0.27
57
58 ## Added ⭐
59
60 - Add `NO_COLOR` support (https://no-color.org/)
61 - Add option to force overwrite `NO_COLOR` (#802)
62 - Add support for scroll left/right events on windows and unix systems (#788).
63 - Add `window_size` function to fetch pixel width/height of screen for more sophisticated rendering in terminals.
64 - Add support for deserializing hex color strings to `Color` e.g #fffff.
65
66 ## Changed ⚙️
67
68 - Make the events module an optional feature `events` (to make crossterm more lightweight) (#776)
69
70 ## Breaking ⚠️
71
72 - Set minimum rustc version to 1.58 (#798)
73 - Change all error types to `std::io::Result` (#765)
74
75 # Version 0.26.1
76
77 ## Added ⭐
78
79 - Add synchronized output/update control (#756)
80 - Add kitty report alternate keys functionality (#754)
81 - Updates dev dependencies.
82
83 ## Fixed 🐛
84 - Fix icorrect return in kitty keyboard enhancement check (#751)
85 - Fix panic when using `use-dev-tty` feature flag (#762)
86
87 # Version 0.26.0
88 ## Added ⭐
89
90 - Add `SetCursorStyle` to set the cursor apearance and visibility. (#742)
91 - Add a function to check if kitty keyboard enhancement protocol is available. (#732)
92 - Add filedescriptors poll in order to move away from mio in the future (can be used via `use-dev-tty`). (#735)
93
94 ## Fixed 🐛
95 - Improved F1-F4 handling for kitty keyboard protocol. (#736)
96 - Improved parsing of event types/modifiers with certain keys for kitty protocol. (#716)
97
98 ## Breaking ⚠️
99 - Remove `SetCursorShape` in favour of `SetCursorStyle`. (#742)
100 - Make Windows resize event match `terminal::size` (#714)
101 - Rust 1.58 or later is now required.
102 - Add key release event for windows. (#745)
103
104 # Version 0.25.0
105 BREAKING: `Copy` trait is removed from `Event`, you can keep it by removing the "bracked-paste" feature flag. However this flag might be standardized in the future.
106 We removed the `Copy` from `Event` because the new `Paste` event, which contains a pasted string into the terminal, which is a non-copy string.
107
108 - Add ability to paste a string in into the terminal and fetch the pasted string via events (see `Event::Paste` and `EnableBracketedPaste `).
109 - Add support for functional key codes from kitty keyboard protocol. Try out by `PushKeyboardEnhancementFlags`. This protocol allows for:
110 - See: https://sw.kovidgoyal.net/kitty/keyboard-protocol/#modifiers
111 - Press, Repeat, Release event kinds.
112 - SUPER, HYPER, META modifiers.
113 - Media keycodes
114 - Right/left SHIFT, Control, Alt, Super, Hyper, Meta
115 - IsoLevel3Shift, IsoLevel5Shift
116 - Capslock, scroll lock, numlock
117 - Printscreen, pauze, menue, keyboard begin.
118 - Create `SetStyle` command to allow setting various styling in one command.
119 - Terminal Focus events (see `Event::FocusGained` and `Event::FocusLost`)
120
121 # Version 0.24.0
122 - Add DoubleUnderlined, Undercurled, Underdots the text, Underdotted, Underdashes, Underdashed attributes and allow coloring their foreground / background color.
123 - Fix windows unicode character parsing, this fixed various key combinations and support typing unicode characters.
124 - Consistency and better documentation on mouse cursor operations (BREAKING CHANGE).
125 - MoveTo, MoveToColumn, MoveToRow are 0-based. (left top most cell is 0,0). Moving like this is absolute
126 - MoveToNextLine, MoveToPreviousLine, MoveUp, MoveDown, MoveRight, MoveLeft are 1-based,. Moving like this is relative. Moving 1 left means moving 1 left. Moving 0 to the left is not possible, wikipedia states that most terminals will just default to 1.
127 - terminal::size returns error when previously it returned (0,0).
128 - Remove println from serialisation code.
129 - Fix mouse up for middle and right buttons.
130 - Fix escape codes on Git-Bash + Windows Terminal / Alacritty / WezTerm.
131 - Add support for cursor keys in application mode.
132 # Version 0.23.2
133 - Update signal-hook and mio to version 0.8.
134
135 # Version 0.23.1
136 - Fix control key parsing problem.
137
138 # Version 0.23
139 - Update dependencies.
140 - Add 0 check for all cursor functions to prevent undefined behaviour.
141 - Add CSIu key parsing for unix.
142 - Improve control character window key parsing supporting (e.g. CTRL [ and ])
143 - Update library to 2021 edition.
144
145 # Version 0.22.1
146 - Update yanked version crossterm-winapi and move to crossterm-winapi 0.9.0.
147 - Changed panic to error when calling disable-mouse capture without setting it first.
148 - Update bitflags dependency.
149
150 # Version 0.22
151 - Fix serde Color serialisation/deserialization inconsistency.
152 - Update crossterm-winapi 0.8.1 to fix panic for certain mouse events
153
154 # Version 0.21
155 - Expose `is_raw` function.
156 - Add 'purge' option on unix system, this clears the entire screen buffer.
157 - Improve serialisation for color enum values.
158
159 # Version 0.20
160 - Update from signal-hook with 'mio-feature flag' to signal-hook-mio 0.2.1.
161 - Manually implements Eq, PartialEq and Hash for KeyEvent improving equality checks and hash calculation.
162 - `crossterm::ErrorKind` to `io::Error`.
163 - Added Cursor Shape Support.
164 - Add support for function keys F13...F20.
165 - Support taking any Display in `SetTitle` command.
166 - Remove lazy_static dependency.
167 - Remove extra Clone bounds in the style module.
168 - Add `MoveToRow` command.
169 - Remove writer parameter from execute_winapi
170
171 # Version 0.19
172 - Use single thread for async event reader.
173 - Patch timeout handling for event polling this was not working correctly.
174 - Add unix support for more key combinations mainly complex ones with ALT/SHIFT/CTRL.
175 - Derive `PartialEq` and `Eq` for ContentStyle
176 - Fix windows resize event size, this used to be the buffer size but is screen size now.
177 - Change `Command::ansi_code` to `Command::write_ansi`, this way the ansi code will be written to given formatter.
178
179 # Version 0.18.2
180 - Fix panic when only setting bold and redirecting stdout.
181 - Use `tty_fd` for set/get terminal attributes
182
183 # Version 0.18.1
184 - Fix enabling ANSI support when stdout is redirected
185 - Update crossterm-winapi to 0.6.2
186
187 # Version 0.18.0
188 - Fix get position bug
189 - Fix windows 8 or lower write to user-given stdout instead of stdout.
190 - Make MoveCursor(Left/Right/Up/Dow) command with input 0 not move.
191 - Switch to futures-core to reduce dependencies.
192 - Command API restricts to only accept `std::io::Write`
193 - Make `supports_ansi` public
194 - Implement ALT + numbers windows systems.
195
196 # Version 0.17.7
197 - Fix cursor position retrieval bug linux.
198
199 # Version 0.17.6
200 - Add functionality to retrieve color based on passed ansi code.
201 - Switch from 'futures' to 'futures-util' crate to reduce dependency count
202 - Mio 0.7 update
203 - signal-hook update
204 - Make windows raw_mode act on CONIN$
205 - Added From<(u8, u8, u8)> Trait to Color::Rgb Enum
206 - Implement Color::try_from()
207 - Implement styler traits for `&'a str`
208
209 # Version 0.17.5
210 - Improved support of keymodifier for linux, arrow keys, function keys, home keys etc.
211 - Add `SetTitle` command to change the terminal title.
212 - Mio 0.7 update
213
214 # Version 0.17.4
215 - Add macros for `Colorize` and `Styler` impls, add an impl for `String`
216 - Add shift modifier to uppercase char events on unix
217
218 # Version 0.17.3
219 - Fix get terminal size mac os, this did not report the correct size.
220
221 # Version 0.17.2
222 - Windows unicode support
223
224 # Version 0.17.1
225 - Reverted bug in 0.17.0: "Make terminal size function fallback to `STDOUT_FILENO` if `/dev/tty` is missing.".
226 - Support for querying whether the current instance is a TTY.
227
228 # Version 0.17
229 - Impl Display for MoveToColumn, MoveToNextLine, MoveToPreviousLine
230 - Make unix event reader always use `/dev/tty`.
231 - Direct write command ansi_codes into formatter instead of double allocation.
232 - Add NONE flag to KeyModifiers
233 - Add support for converting chars to StylizedContent
234 - Make terminal size function fallback to `STDOUT_FILENO` if `/dev/tty` is missing.
235
236 # Version 0.16.0
237 - Change attribute vector in `ContentStyle` to bitmask.
238 - Add `SetAttributes` command.
239 - Add `Attributes` type, which is a bitfield of enabled attributes.
240 - Remove `exit()`, was useless.
241
242 # Version 0.15.0
243 - Fix CTRL + J key combination. This used to return an ENTER event.
244 - Add a generic implementation `Command` for `&T: Command`. This allows commands to be queued by reference, as well as by value.
245 - Remove unnecessary `Clone` trait bounds from `StyledContent`.
246 - Add `StyledContent::style_mut`.
247 - Handle error correctly for `execute!` and `queue!`.
248 - Fix minor syntax bug in `execute!` and `queue!`.
249 - Change `ContentStyle::apply` to take self by value instead of reference, to prevent an unnecessary extra clone.
250 - Added basic trait implementations (`Debug`, `Clone`, `Copy`, etc) to all of the command structs
251 - `ResetColor` uses `&'static str` instead of `String`
252
253 # Version 0.14.2
254 - Fix TIOCGWINSZ for FreeBSD
255
256 # Version 0.14.1
257 - Made windows cursor position relative to the window instead absolute to the screen buffer windows.
258 - Fix windows bug with `queue` macro were it consumed a type and required an type to be `Copy`.
259
260 # Version 0.14
261
262 - Replace the `input` module with brand new `event` module
263 - Terminal Resize Events
264 - Advanced modifier (SHIFT | ALT | CTRL) support for both mouse and key events and
265 - futures Stream (feature 'event-stream')
266 - Poll/read API
267 - It's **highly recommended** to read the
268 [Upgrade from 0.13 to 0.14](https://github.com/crossterm-rs/crossterm/wiki/Upgrade-from-0.13-to-0.14)
269 documentation
270 - Replace `docs/UPGRADE.md` with the [Upgrade Paths](https://github.com/crossterm-rs/crossterm/wiki#upgrade-paths)
271 documentation
272 - Add `MoveToColumn`, `MoveToPreviousLine`, `MoveToNextLine` commands
273 - Merge `screen` module into `terminal`
274 - Remove `screen::AlternateScreen`
275 - Remove `screen::Rawscreen`
276 * Move and rename `Rawscreen::into_raw_mode` and `Rawscreen::disable_raw_mode` to `terminal::enable_raw_mode` and `terminal::disable_raw_mode`
277 - Move `screen::EnterAlternateScreen` and `screen::LeaveAlternateScreen` to `terminal::EnterAlternateScreen` and `terminal::LeaveAlternateScreen`
278 - Replace `utils::Output` command with `style::Print` command
279 - Fix enable/disable mouse capture commands on Windows
280 - Allow trailing comma `queue!` & `execute!` macros
281
282 # Version 0.13.3
283
284 - Remove thread from AsyncReader on Windows.
285 - Improve HANDLE management windows.
286
287 # Version 0.13.2
288
289 - New `input::stop_reading_thread()` function
290 - Temporary workaround for the UNIX platform to stop the background
291 reading thread and close the file descriptor
292 - This function will be removed in the next version
293
294 # Version 0.13.1
295
296 - Async Reader fix, join background thread and avoid looping forever on windows.
297
298 # Version 0.13.0
299
300 **Major API-change, removed old-api**
301
302 - Remove `Crossterm` type
303 - Remove `TerminalCursor`, `TerminalColor`, `Terminal`
304 - Remove `cursor()`, `color()` , `terminal()`
305 - Remove re-exports at root, accessible via `module::types` (`cursor::MoveTo`)
306 - `input` module
307 - Derive 'Copy' for 'KeyEvent'
308 - Add the `EnableMouseCapture` and `EnableMouseCapture` commands
309 - `cursor` module
310 - Introduce static function `crossterm::cursor::position` in place of `TerminalCursor::pos`
311 - Rename `Goto` to `MoveTo`
312 - Rename `Up` to `MoveLeft`
313 - Rename `Right` to `MoveRight`
314 - Rename `Down` to `MoveDown`
315 - Rename `BlinkOn` to `EnableBlinking`
316 - Rename `BlinkOff` to `DisableBlinking`
317 - Rename `ResetPos` to `ResetPosition`
318 - Rename `SavePos` to `SavePosition`
319 - `terminal`
320 - Introduce static function `crossterm::terminal::size` in place of `Terminal::size`
321 - Introduce static function `crossterm::terminal::exit` in place of `Terminal::exit`
322 - `style module`
323 - Rename `ObjectStyle` to `ContentStyle`. Now full names are used for methods
324 - Rename `StyledObject` to `StyledContent` and made members private
325 - Rename `PrintStyledFont` to `PrintStyledContent`
326 - Rename `attr` method to `attribute`.
327 - Rename `Attribute::NoInverse` to `NoReverse`
328 - Update documentation
329 - Made `Colored` private, user should use commands instead
330 - Rename `SetFg` -> `SetForegroundColor`
331 - Rename `SetBg` -> `SetBackgroundColor`
332 - Rename `SetAttr` -> `SetAttribute`
333 - Rename `ContentStyle::fg_color` -> `ContentStyle::foreground_color`
334 - Rename `ContentStyle::bg_color` -> `ContentStyle::background_color`
335 - Rename `ContentStyle::attrs` -> `ContentStyle::attributes`
336 - Improve documentation
337 - Unix terminal size calculation with TPUT
338
339 # Version 0.12.1
340
341 - Move all the `crossterm_` crates code was moved to the `crossterm` crate
342 - `crossterm_cursor` is in the `cursor` module, etc.
343 - All these modules are public
344 - No public API breaking changes
345
346 # Version 0.12.0
347
348 - Following crates are deprecated and no longer maintained
349 - `crossterm_cursor`
350 - `crossterm_input`
351 - `crossterm_screen`
352 - `crossterm_style`
353 - `crossterm_terminal`
354 - `crossterm_utils`
355
356 ## `crossterm_cursor` 0.4.0
357
358 - Fix examples link ([PR #6](https://github.com/crossterm-rs/crossterm-cursor/pull/6))
359 - Sync documentation style ([PR #7](https://github.com/crossterm-rs/crossterm-cursor/pull/7))
360 - Remove all references to the crossterm book ([PR #8](https://github.com/crossterm-rs/crossterm-cursor/pull/8))
361 - Replace `RAW_MODE_ENABLED` with `is_raw_mode_enabled` ([PR #9](https://github.com/crossterm-rs/crossterm-cursor/pull/9))
362 - Use `SyncReader` & `InputEvent::CursorPosition` for `pos_raw()` ([PR #10](https://github.com/crossterm-rs/crossterm-cursor/pull/10))
363
364 ## `crossterm_input` 0.5.0
365
366 - Sync documentation style ([PR #4](https://github.com/crossterm-rs/crossterm-input/pull/4))
367 - Sync `SyncReader::next()` Windows and UNIX behavior ([PR #5](https://github.com/crossterm-rs/crossterm-input/pull/5))
368 - Remove all references to the crossterm book ([PR #6](https://github.com/crossterm-rs/crossterm-input/pull/6))
369 - Mouse coordinates synchronized with the cursor ([PR #7](https://github.com/crossterm-rs/crossterm-input/pull/7))
370 - Upper/left reported as `(0, 0)`
371 - Fix bug that read sync didn't block (Windows) ([PR #8](https://github.com/crossterm-rs/crossterm-input/pull/8))
372 - Refactor UNIX readers ([PR #9](https://github.com/crossterm-rs/crossterm-input/pull/9))
373 - AsyncReader produces mouse events
374 - One reading thread per application, not per `AsyncReader`
375 - Cursor position no longer consumed by another `AsyncReader`
376 - Implement sync reader for read_char (requires raw mode)
377 - Fix `SIGTTIN` when executed under the LLDB
378 - Add mio for reading from FD and more efficient polling (UNIX only)
379 - Sync UNIX and Windows vertical mouse position ([PR #11](https://github.com/crossterm-rs/crossterm-input/pull/11))
380 - Top is always reported as `0`
381
382 ## `crossterm_screen` 0.3.2
383
384 - `to_alternate` switch back to main screen if it fails to switch into raw mode ([PR #4](https://github.com/crossterm-rs/crossterm-screen/pull/4))
385 - Improve the documentation ([PR #5](https://github.com/crossterm-rs/crossterm-screen/pull/5))
386 - Public API
387 - Include the book content in the documentation
388 - Remove all references to the crossterm book ([PR #6](https://github.com/crossterm-rs/crossterm-screen/pull/6))
389 - New commands introduced ([PR #7](https://github.com/crossterm-rs/crossterm-screen/pull/7))
390 - `EnterAlternateScreen`
391 - `LeaveAlternateScreen`
392 - Sync Windows and UNIX raw mode behavior ([PR #8](https://github.com/crossterm-rs/crossterm-screen/pull/8))
393
394 ## `crossterm_style` 0.5.2
395
396 - Refactor ([PR #2](https://github.com/crossterm-rs/crossterm-style/pull/2))
397 - Added unit tests
398 - Improved documentation and added book page to `lib.rs`
399 - Fixed bug with `SetBg` command, WinApi logic
400 - Fixed bug with `StyledObject`, used stdout for resetting terminal color
401 - Introduced `ResetColor` command
402 - Sync documentation style ([PR #3](https://github.com/crossterm-rs/crossterm-style/pull/3))
403 - Remove all references to the crossterm book ([PR #4](https://github.com/crossterm-rs/crossterm-style/pull/4))
404 - Windows 7 grey/white foreground/intensity swapped ([PR #5](https://github.com/crossterm-rs/crossterm-style/pull/5))
405
406 ## `crossterm_terminal` 0.3.2
407
408 - Removed `crossterm_cursor::sys` dependency ([PR #2](https://github.com/crossterm-rs/crossterm-terminal/pull/2))
409 - Internal refactoring & documentation ([PR #3](https://github.com/crossterm-rs/crossterm-terminal/pull/3))
410 - Removed all references to the crossterm book ([PR #4](https://github.com/crossterm-rs/crossterm-terminal/pull/4))
411
412 ## `crossterm_utils` 0.4.0
413
414 - Add deprecation note ([PR #3](https://github.com/crossterm-rs/crossterm-utils/pull/3))
415 - Remove all references to the crossterm book ([PR #4](https://github.com/crossterm-rs/crossterm-utils/pull/4))
416 - Remove unsafe static mut ([PR #5](https://github.com/crossterm-rs/crossterm-utils/pull/5))
417 - `sys::unix::RAW_MODE_ENABLED` replaced with `sys::unix::is_raw_mode_enabled()` (breaking)
418 - New `lazy_static` dependency
419
420 ## `crossterm_winapi` 0.3.0
421
422 - Make read sync block for windows systems ([PR #2](https://github.com/crossterm-rs/crossterm-winapi/pull/2))
423
424 # Version 0.11.1
425
426 - Maintenance release
427 - All sub-crates were moved to their own repositories in the `crossterm-rs` organization
428
429 # Version 0.11.0
430
431 As a preparation for crossterm 0.1.0 we have moved crossterm to an organisation called 'crossterm-rs'.
432
433 ### Code Quality
434
435 - Code Cleanup: [warning-cleanup], [crossterm_style-cleanup], [crossterm_screen-cleanup], [crossterm_terminal-cleanup], [crossterm_utils-cleanup], [2018-cleanup], [api-cleanup-1], [api-cleanup-2], [api-cleanup-3]
436 - Examples: [example-cleanup_1], [example-cleanup_2], [example-fix], [commandbar-fix], [snake-game-improved]
437 - Fixed all broken tests and added tests
438
439 ### Important Changes
440
441 - Return written bytes: [return-written-bytes]
442 - Added derives: `Debug` for `ObjectStyle` [debug-derive], Serialize/Deserialize for key events [serde]
443 - Improved error handling:
444 - Return `crossterm::Result` from all api's: [return_crossterm_result]
445 * `TerminalCursor::pos()` returns `Result<(u16, u16)>`
446 * `Terminal::size()` returns `Result<(u16, u16)>`
447 * `TerminalCursor::move_*` returns `crossterm::Result`
448 * `ExecutableCommand::queue` returns `crossterm::Result`
449 * `QueueableCommand::queue` returns `crossterm::Result`
450 * `get_available_color_count` returns no result
451 * `RawScreen::into_raw_mode` returns `crossterm::Result` instead of `io::Result`
452 * `RawScreen::disable_raw_mode` returns `crossterm::Result` instead of `io::Result`
453 * `AlternateScreen::to_alternate` returns `crossterm::Result` instead of `io::Result`
454 * `TerminalInput::read_line` returns `crossterm::Result` instead of `io::Result`
455 * `TerminalInput::read_char` returns `crossterm::Result` instead of `io::Result`
456 * Maybe I forgot something, a lot of functions have changed
457 - Removed all unwraps/expects from library
458 - Add KeyEvent::Enter and KeyEvent::Tab: [added-key-event-enter], [added-key-event-tab]
459 - Sync set/get terminal size behaviour: [fixed-get-set-terminal-size]
460 - Method renames:
461 * `AsyncReader::stop_reading()` to `stop()`
462 * `RawScreen::disable_raw_mode_on_drop` to `keep_raw_mode_on_drop`
463 * `TerminalCursor::reset_position()` to `restore_position()`
464 * `Command::get_anis_code()` to `ansi_code()`
465 * `available_color_count` to `available_color_count()`
466 * `Terminal::terminal_size` to `Terminal::size`
467 * `Console::get_handle` to `Console::handle`
468 - All `i16` values for indexing: set size, set cursor pos, scrolling synced to `u16` values
469 - Command API takes mutable self instead of self
470
471 [serde]: https://github.com/crossterm-rs/crossterm/pull/190
472
473 [debug-derive]: https://github.com/crossterm-rs/crossterm/pull/192
474 [example-fix]: https://github.com/crossterm-rs/crossterm/pull/193
475 [commandbar-fix]: https://github.com/crossterm-rs/crossterm/pull/204
476
477 [warning-cleanup]: https://github.com/crossterm-rs/crossterm/pull/198
478 [example-cleanup_1]: https://github.com/crossterm-rs/crossterm/pull/196
479 [example-cleanup_2]: https://github.com/crossterm-rs/crossterm/pull/225
480 [snake-game-improved]: https://github.com/crossterm-rs/crossterm/pull/231
481 [crossterm_style-cleanup]: https://github.com/crossterm-rs/crossterm/pull/208
482 [crossterm_screen-cleanup]: https://github.com/crossterm-rs/crossterm/pull/209
483 [crossterm_terminal-cleanup]: https://github.com/crossterm-rs/crossterm/pull/210
484 [crossterm_utils-cleanup]: https://github.com/crossterm-rs/crossterm/pull/211
485 [2018-cleanup]: https://github.com/crossterm-rs/crossterm/pull/222
486 [wild-card-cleanup]: https://github.com/crossterm-rs/crossterm/pull/224
487
488 [api-cleanup-1]: https://github.com/crossterm-rs/crossterm/pull/235
489 [api-cleanup-2]: https://github.com/crossterm-rs/crossterm/pull/238
490 [api-cleanup-3]: https://github.com/crossterm-rs/crossterm/pull/240
491
492 [return-written-bytes]: https://github.com/crossterm-rs/crossterm/pull/212
493
494 [return_crossterm_result]: https://github.com/crossterm-rs/crossterm/pull/232
495 [added-key-event-tab]: https://github.com/crossterm-rs/crossterm/pull/239
496 [added-key-event-enter]: https://github.com/crossterm-rs/crossterm/pull/236
497 [fixed-get-set-terminal-size]: https://github.com/crossterm-rs/crossterm/pull/242
498
499 # Version 0.10.1
500
501 # Version 0.10.0 ~ yanked
502 - Implement command API, to have better performance and more control over how and when commands are executed. [PR](https://github.com/crossterm-rs/crossterm/commit/1a60924abd462ab169b6706aab68f4cca31d7bc2), [issue](https://github.com/crossterm-rs/crossterm/issues/171)
503 - Fix showing, hiding cursor windows implementation
504 - Remove some of the parsing logic from windows keys to ansi codes to key events [PR](https://github.com/crossterm-rs/crossterm/commit/762c3a9b8e3d1fba87acde237f8ed09e74cd9ecd)
505 - Made terminal size 1-based [PR](https://github.com/crossterm-rs/crossterm/commit/d689d7e8ed46a335474b8262bd76f21feaaf0c50)
506 - Add some derives
507
508 # Version 0.9.6
509
510 - Copy for KeyEvent
511 - CTRL + Left, Down, Up, Right key support
512 - SHIFT + Left, Down, Up, Right key support
513 - Fixed UNIX cursor position bug [issue](https://github.com/crossterm-rs/crossterm/issues/140), [PR](https://github.com/crossterm-rs/crossterm/pull/152)
514
515 # Version 0.9.5
516
517 - Prefetch buffer size for more efficient windows input reads. [PR](https://github.com/crossterm-rs/crossterm/pull/144)
518
519 # Version 0.9.4
520
521 - Reset foreground and background color individually. [PR](https://github.com/crossterm-rs/crossterm/pull/138)
522 - Backtap input support. [PR](https://github.com/crossterm-rs/crossterm/pull/129)
523 - Corrected white/grey and added dark grey.
524 - Fixed getting cursor position with raw screen enabled. [PR](https://github.com/crossterm-rs/crossterm/pull/134)
525 - Removed one redundant stdout lock
526
527 # Version 0.9.3
528
529 - Removed println from `SyncReader`
530
531 ## Version 0.9.2
532
533 - Terminal size linux was not 0-based
534 - Windows mouse input event position was 0-based and should be 1-based
535 - Result, ErrorKind are made re-exported
536 - Fixed some special key combination detections for UNIX systems
537 - Made FreeBSD compile
538
539 ## Version 0.9.1
540
541 - Fixed libc compile error
542
543 ## Version 0.9.0 (yanked)
544
545 This release is all about moving to a stabilized API for 1.0.
546
547 - Major refactor and cleanup.
548 - Improved performance;
549 - No locking when writing to stdout.
550 - UNIX doesn't have any dynamic dispatch anymore.
551 - Windows has improved the way to check if ANSI modes are enabled.
552 - Removed lot's of complex API calls: `from_screen`, `from_output`
553 - Removed `Arc<TerminalOutput>` from all internal Api's.
554 - Removed termios dependency for UNIX systems.
555 - Upgraded deps.
556 - Removed about 1000 lines of code
557 - `TerminalOutput`
558 - `Screen`
559 - unsafe code
560 - Some duplicated code introduced by a previous refactor.
561 - Raw modes UNIX systems improved
562 - Added `NoItalic` attribute
563
564 ## Version 0.8.2
565
566 - Bug fix for sync reader UNIX.
567
568 ## Version 0.8.1
569
570 - Added public re-exports for input.
571
572 # Version 0.8.0
573
574 - Introduced KeyEvents
575 - Introduced MouseEvents
576 - Upgraded crossterm_winapi 0.2
577
578 # Version 0.7.0
579
580 - Introduced more `Attributes`
581 - Introduced easier ways to style text [issue 87](https://github.com/crossterm-rs/crossterm/issues/87).
582 - Removed `ColorType` since it was unnecessary.
583
584 # Version 0.6.0
585
586 - Introduced feature flags; input, cursor, style, terminal, screen.
587 - All modules are moved to their own crate.
588 - Introduced crossterm workspace
589 - Less dependencies.
590 - Improved namespaces.
591
592 [PR 84](https://github.com/crossterm-rs/crossterm/pull/84)
593
594 # Version 0.5.5
595
596 - Error module is made public [PR 78](https://github.com/crossterm-rs/crossterm/pull/78).
597
598 # Version 0.5.4
599
600 - WinApi rewrite and correctly error handled [PR 67](https://github.com/crossterm-rs/crossterm/pull/67)
601 - Windows attribute support [PR 62](https://github.com/crossterm-rs/crossterm/pull/62)
602 - Readline bug fix windows systems [PR 62](https://github.com/crossterm-rs/crossterm/pull/62)
603 - Error handling improvement.
604 - General refactoring, all warnings removed.
605 - Documentation improvement.
606
607 # Version 0.5.1
608
609 - Documentation refactor.
610 - Fixed broken API documentation [PR 53](https://github.com/crossterm-rs/crossterm/pull/53).
611
612 # Version 0.5.0
613
614 - Added ability to pause the terminal [issue](https://github.com/crossterm-rs/crossterm/issues/39)
615 - RGB support for Windows 10 systems
616 - ANSI color value (255) color support
617 - More convenient API, no need to care about `Screen` unless working with when working with alternate or raw screen [PR](https://github.com/crossterm-rs/crossterm/pull/44)
618 - Implemented Display for styled object
619
620 # Version 0.4.3
621
622 - Fixed bug [issue 41](https://github.com/crossterm-rs/crossterm/issues/41)
623
624 # Version 0.4.2
625
626 - Added functionality to make a styled object writable to screen [issue 33](https://github.com/crossterm-rs/crossterm/issues/33)
627 - Added unit tests.
628 - Bugfix with getting terminal size unix.
629 - Bugfix with returning written bytes [pull request 31](https://github.com/crossterm-rs/crossterm/pull/31)
630 - removed methods calls: `as_any()` and `as_any_mut()` from `TerminalOutput`
631
632 # Version 0.4.1
633
634 - Fixed resizing of ansi terminal with and height where in the wrong order.
635
636 # Version 0.4.0
637
638 - Input support (read_line, read_char, read_async, read_until_async)
639 - Styling module improved
640 - Everything is multithreaded (`Send`, `Sync`)
641 - Performance enhancements: removed mutexes, removed state manager, removed context type removed unnecessarily RC types.
642 - Bug fix resetting console color.
643 - Bug fix whit undoing raw modes.
644 - More correct error handling.
645 - Overall command improvement.
646 - Overall refactor of code.
647
648 # Version 0.3.0
649
650 This version has some braking changes check [upgrade manual](UPGRADE%20Manual.md) for more information about what is changed.
651 I think you should not switch to version `0.3.0` if you aren't going to use the AlternateScreen feature.
652 Because you will have some work to get to the new version of crossterm depending on your situation.
653
654 Some Features crossterm 0.3.0
655 - Alternate Screen for windows and unix systems.
656 - Raw screen for unix and windows systems [Issue 5](https://github.com/crossterm-rs/crossterm/issues/5)..
657 - Hiding an showing the cursor.
658 - Control over blinking of the terminal cursor (only some terminals are supporting this).
659 - The terminal state will be set to its original state when process ends [issue7](https://github.com/crossterm-rs/crossterm/issues/7).
660 - exit the current process.
661
662 ## Alternate screen
663
664 This create supports alternate screen for both windows and unix systems. You can use
665
666 *Nix style applications often utilize an alternate screen buffer, so that they can modify the entire contents of the buffer, without affecting the application that started them.
667 The alternate buffer is exactly the dimensions of the window, without any scrollback region.
668 For an example of this behavior, consider when vim is launched from bash.
669 Vim uses the entirety of the screen to edit the file, then returning to bash leaves the original buffer unchanged.
670
671 I Highly recommend you to check the `examples/program_examples/first_depth_search` for seeing this in action.
672
673 ## Raw screen
674
675 This crate now supports raw screen for both windows and unix systems.
676 What exactly is raw state:
677 - No line buffering.
678 Normally the terminals uses line buffering. This means that the input will be send to the terminal line by line.
679 With raw mode the input will be send one byte at a time.
680 - Input
681 All input has to be written manually by the programmer.
682 - Characters
683 The characters are not processed by the terminal driver, but are sent straight through.
684 Special character have no meaning, like backspace will not be interpret as backspace but instead will be directly send to the terminal.
685 With these modes you can easier design the terminal screen.
686
687 ## Some functionalities added
688
689 - Hiding and showing terminal cursor
690 - Enable or disabling blinking of the cursor for unix systems (this is not widely supported)
691 - Restoring the terminal to original modes.
692 - Added a [wrapper](https://github.com/crossterm-rs/crossterm/blob/master/src/shared/crossterm.rs) for managing all the functionalities of crossterm `Crossterm`.
693 - Exit the current running process
694
695 ## Examples
696 Added [examples](https://github.com/crossterm-rs/crossterm/tree/master/examples) for each version of the crossterm version.
697 Also added a folder with some [real life examples](https://github.com/crossterm-rs/crossterm/tree/master/examples/program_examples).
698
699 ## Context
700
701 What is the `Context` all about? This `Context` has several reasons why it is introduced into `crossterm version 0.3.0`.
702 These points are related to the features like `Alternatescreen` and managing the terminal state.
703
704 - At first `Terminal state`:
705
706 Because this is a terminal manipulating library there will be made changes to terminal when running an process.
707 If you stop the process you want the terminal back in its original state.
708 Therefore, I need to track the changes made to the terminal.
709
710 - At second `Handle to the console`
711
712 In Rust we can use `stdout()` to get an handle to the current default console handle.
713 For example when in unix systems you want to print something to the main screen you can use the following code:
714
715 write!(std::io::stdout(), "{}", "some text").
716
717 But things change when we are in alternate screen modes.
718 We can not simply use `stdout()` to get a handle to the alternate screen, since this call returns the current default console handle (handle to mainscreen).
719
720 Because of that we need to store an handle to the current screen.
721 This handle could be used to put into alternate screen modes and back into main screen modes.
722 Through this stored handle Crossterm can execute its command and write on and to the current screen whether it be alternate screen or main screen.
723
724 For unix systems we store the handle gotten from `stdout()` for windows systems that are not supporting ANSI escape codes we store WinApi `HANDLE` struct witch will provide access to the current screen.
725
726 So to recap this `Context` struct is a wrapper for a type that manges terminal state changes.
727 When this `Context` goes out of scope all changes made will be undone.
728 Also is this `Context` is a wrapper for access to the current console screen.
729
730 Because Crossterm needs access to the above to types quite often I have chosen to add those two in one struct called `Context` so that this type could be shared throughout library.
731 Check this link for more info: [cleanup of rust code](https://stackoverflow.com/questions/48732387/how-can-i-run-clean-up-code-in-a-rust-library).
732 More info over writing to alternate screen buffer on windows and unix see this [link](https://github.com/crossterm-rs/crossterm/issues/17)
733
734 __Now the user has to pass an context type to the modules of Crossterm like this:__
735
736 let context = Context::new();
737
738 let cursor = cursor(&context);
739 let terminal = terminal(&context);
740 let color = color(&context);
741
742 Because this looks a little odd I will provide a type widths will manage the `Context` for you. You can call the different modules like the following:
743
744 let crossterm = Crossterm::new();
745 let color = crossterm.color();
746 let cursor = crossterm.cursor();
747 let terminal = crossterm.terminal();
748
749
750 ### Alternate screen
751 When you want to switch to alternate screen there are a couple of things to keep in mind for it to work correctly.
752 First off some code of how to switch to Alternate screen, for more info check the [alternate screen example](https://github.com/crossterm-rs/crossterm/blob/master/examples/alternate_screen.rs).
753
754 _Create alternate screen from `Context`_
755
756 // create context.
757 let context = crossterm::Context::new();
758 // create instance of Alternatescreen by the given context, this will also switch to it.
759 let mut screen = crossterm::AlternateScreen::from(context.clone());
760 // write to the alternate screen.
761 write!(screen, "test");
762
763 _Create alternate screen from `Crossterm`:_
764
765 // create context.
766 let crossterm = ::crossterm::Crossterm::new();
767 // create instance of Alternatescreen by the given reference to crossterm, this will also switch to it.
768 let mut screen = crossterm::AlternateScreen::from(&crossterm);
769 // write to the alternate screen.
770 write!(screen, "test");
771
772 like demonstrated above, to get the functionalities of `cursor(), color(), terminal()` also working on alternate screen.
773 You need to pass it the same `Context` as you have passed to the previous three called functions,
774 If you don't use the same `Context` in `cursor(), color(), terminal()` than these modules will be using the main screen and you will not see anything at the alternate screen. If you use the [Crossterm](https://github.com/crossterm-rs/crossterm/blob/master/src/shared/crossterm.rs) type you can get the `Context` from it by calling the crossterm.get_context() whereafter you can create the AlternateScreen from it.
775
776 # Version 0.2.2
777
778 - Bug see [issue 15](https://github.com/crossterm-rs/crossterm/issues/15)
779
780 # Version 0.2.1
781
782 - Default ANSI escape codes for windows machines, if windows does not support ANSI switch back to WinApi.
783 - method grammar mistake fixed [Issue 3](https://github.com/crossterm-rs/crossterm/issues/3)
784 - Some Refactorings in method names see [issue 4](https://github.com/crossterm-rs/crossterm/issues/4)
785 - Removed bin reference from crate [Issue 6](https://github.com/crossterm-rs/crossterm/issues/6)
786 - Get position unix fixed [issue 8](https://github.com/crossterm-rs/crossterm/issues/8)
787
788 # Version 0.2
789
790 - 256 color support.
791 - Text Attributes like: bold, italic, underscore and crossed word etc.
792 - Custom ANSI color code input to set fore- and background color for unix.
793 - Storing the current cursor position and resetting to that stored cursor position later.
794 - Resizing the terminal.