crossterm
A crossplatform terminal library for manipulating terminals.
0.29.0
177M downloads/mo
#550 most downloaded on crates.io
crossterm-rs/crossterm
What this package is like to depend on
Last release 1 years ago
05 Apr 2025
Release timing varies
gaps range from 3 weeks to 12 months
Most releases are documented
notes for 48 of 64 stable releases
6 versions withdrawn
withdrawn after publishing
9 years old
70 releases · first in 2018
0 releases in the last 12 months
see the full history below
Release timeline
70 releases · Jan 2018 to Apr 2025Releases
latest 60 of 70-
0.29.005 Apr 2025Nothing published for this version
-
0.28.101 Aug 2024Release notes
Open source →Fixed 🐛
- Fix broken build on linux when using
use-dev-ttywith (#906)
Breaking ⚠️
- Fix desync with mio and signalhook between repo and published crate. (upgrade to mio 1.0)
- Fix broken build on linux when using
-
0.28.031 Jul 2024 withdrawnNothing published for this version
-
0.27.006 Aug 2023Release notes
Open source →Version 0.27
Added ⭐
- Add
NO_COLORsupport (https://no-color.org/) - Add option to force overwrite
NO_COLOR(#802) - Add support for scroll left/right events on windows and unix systems (#788).
- Add
window_sizefunction to fetch pixel width/height of screen for more sophisticated rendering in terminals. - Add support for deserializing hex color strings to `Color`` e.g #fffff.
Changes
- Make the events module an optional feature
events(to make crossterm more lightweight) (#776)
Breaking ⚠️
@Gronis, @kevin-vigor, @Wilfred, @benjajaja, @blt-r, @Piturnah, @kdheepak, @DeathVenom54, @senekor, @joseluis, @gibbz00, @lesleyrs, @jhartzell42
- Add
-
0.26.126 Feb 2023Release notes
Open source →Version 0.26.1
Added ⭐
- Add synchronized output/update control (#756)
- Add kitty report alternate keys functionality (#754)
- Updated dev dependencies.
Fixed 🐛
- Fix incorrect return in kitty keyboard enhancement check (#751)
- Fix panic when using
use-dev-ttyfeature flag (#762)
Contributors
Release notes
Open source →Added ⭐
- Add synchronized output/update control (#756)
- Add kitty report alternate keys functionality (#754)
- Updates dev dependencies.
Fixed 🐛
- Fix icorrect return in kitty keyboard enhancement check (#751)
- Fix panic when using
use-dev-ttyfeature flag (#762)
-
0.26.028 Jan 2023Release notes
Open source →Added ⭐
- Add
SetCursorStyleto set the cursor appearance and visibility. (#742) - Add key release event for windows. (#745)
- Add a function to check if the kitty keyboard enhancement protocol is available. (#732)
- Add filedescriptors poll in order to move away from mio in the future (can be used via
use-dev-tty). (#735)
Fixed 🐛
- Improved F1-F4 handling for kitty keyboard protocol. (#736)
- Improved parsing of event types/modifiers with certain keys for kitty protocol. (#716)
Breaking ⚠️
- Remove
SetCursorShapein vavour ofSetCursorStyle. (#742) - Make Windows resize event match
terminal::size(#714)
Contributors
@pianohacker , @AhoyISki , @Cl00e9ment , @yyogo , @the-mikedavis , @djarb , @Piturnah , @MitMaro , @Yusuto , @generic-user1 , @baldoalessandro , @CenTdemeern1 , @Blatko1 , @aaarkid @basilkohler , @TimonPost
Release notes
Open source →Added ⭐
- Add
SetCursorStyleto set the cursor apearance and visibility. (#742) - Add a function to check if kitty keyboard enhancement protocol is available. (#732)
- Add filedescriptors poll in order to move away from mio in the future (can be used via
use-dev-tty). (#735)
Fixed 🐛
- Improved F1-F4 handling for kitty keyboard protocol. (#736)
- Improved parsing of event types/modifiers with certain keys for kitty protocol. (#716)
Breaking ⚠️
- Remove
SetCursorShapein favour ofSetCursorStyle. (#742) - Make Windows resize event match
terminal::size(#714) - Rust 1.58 or later is now required.
- Add key release event for windows. (#745)
- Add
-
0.25.010 Aug 2022Release notes
Open source →BREAKING:
Copytrait is removed fromEvent, you can keep it by removing the "bracked-paste" feature flag. However this flag might be standardized in the future. We removed theCopyfromEventbecause the newPasteevent, which contains a pasted string into the terminal, which is a non-copy string.- Add ability to paste a string in into the terminal and fetch the pasted string via events (see
Event::PasteandEnableBracketedPaste). - Add support for functional key codes from kitty keyboard protocol. Try out by
PushKeyboardEnhancementFlags. This protocol allows for:- See: https://sw.kovidgoyal.net/kitty/keyboard-protocol/#modifiers
- Press, Repeat, Release event kinds.
- SUPER, HYPER, META modifiers.
- Media keycodes
- Right/left SHIFT, Control, Alt, Super, Hyper, Meta
- IsoLevel3Shift, IsoLevel5Shift
- Capslock, scroll lock, numlock
- Printscreen, pauze, menue, keyboard begin.
- Create
SetStylecommand to allow setting various styling in one command. - Terminal Focus events (see
Event::FocusGainedandEvent::FocusLost)
- Add ability to paste a string in into the terminal and fetch the pasted string via events (see
-
0.24.002 Jul 2022Release notes
Open source →- Add DoubleUnderlined, Undercurled, Underdots the text, Underdotted, Underdashes, Underdashed attributes and allow coloring their foreground / background color.
- Fix windows unicode character parsing, this fixed various key combinations and support typing unicode characters.
- Consistency and better documentation on mouse cursor operations (BREAKING CHANGE).
- MoveTo, MoveToColumn, MoveToRow are 0-based. (left top most cell is 0,0). Moving like this is absolute
- 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.
- terminal::size returns error when previously it returned (0,0).
- Remove println from serialisation code.
- Fix mouse up for middle and right buttons.
- Fix escape codes on Git-Bash + Windows Terminal / Alacritty / WezTerm.
- Add support for cursor keys in application mode.
-
0.23.204 Apr 2022 -
0.23.115 Mar 2022 -
0.23.006 Feb 2022Nothing published for this version
-
0.22.119 Oct 2021Release notes
Open source →- Update yanked version crossterm-winapi and move to crossterm-winapi 0.9.0.
- Changed panic to error when calling disable-mouse capture without setting it first.
- Update bitflags dependency.
Release notes
Open source →- Update yanked version crossterm-winapi and move to crossterm-winapi 0.9.0.
- Changed panic to error when calling disable-mouse capture without setting it first.
- Update bitflags dependency.
-
0.21.023 Aug 2021Nothing published for this version
-
0.20.010 Jun 2021Nothing published for this version
-
0.19.028 Dec 2020Nothing published for this version
-
0.18.229 Oct 2020Release notes
Open source →- Fix panic when only setting bold and redirecting stdout.
- Use
tty_fdfor set/get terminal attributes
-
0.18.124 Oct 2020Release notes
Open source →- Fix enabling ANSI support when stdout is redirected
- Update crossterm-winapi to 0.6.2
-
0.18.029 Sep 2020Release notes
Open source →- Fix get position bug
- Fix windows 8 or lower write to user-given stdout instead of stdout.
- Make MoveCursor(Left/Right/Up/Dow) command with input 0 not move.
- Switch to futures-core to reduce dependencies.
- Command API restricts to only accept
std::io::Write - Make
supports_ansipublic - Implement ALT + numbers windows systems.
-
0.17.808 Sep 2020 withdrawnNothing published for this version
-
0.17.713 Jul 2020 -
0.17.606 Jul 2020 withdrawnRelease notes
Open source →- Add functionality to retrieve color based on passed ansi code.
- Switch from 'futures' to 'futures-util' crate to reduce dependency count
- Mio 0.7 update
- signal-hook update
- Make windows raw_mode act on CONIN$
- Added From<(u8, u8, u8)> Trait to Color::Rgb Enum
- Implement Color::try_from()
- Implement styler traits for
&'a str
-
0.17.523 May 2020Release notes
Open source →- Improved support of keymodifier for linux, arrow keys, function keys, home keys etc.
- Add
SetTitlecommand to change the terminal title. - Mio 0.7 update
-
0.17.402 May 2020Release notes
Open source →- Add macros for
ColorizeandStylerimpls, add an impl forString - Add shift modifier to uppercase char events on unix
- Add macros for
-
0.17.309 Apr 2020 -
0.17.208 Apr 2020 -
0.17.128 Mar 2020Release notes
Open source →- Reverted bug in 0.17.0: "Make terminal size function fallback to
STDOUT_FILENOif/dev/ttyis missing.". - Support for querying whether the current instance is a TTY.
- Reverted bug in 0.17.0: "Make terminal size function fallback to
-
0.17.024 Mar 2020Nothing published for this version
-
0.16.008 Feb 2020Release notes
Open source →- Change attribute vector in
ContentStyleto bitmask. - Add
SetAttributescommand. - Add
Attributestype, which is a bitfield of enabled attributes. - Remove
exit(), was useless.
- Change attribute vector in
-
0.15.029 Jan 2020Release notes
Open source →- Fix CTRL + J key combination. This used to return an ENTER event.
- Add a generic implementation
Commandfor&T: Command. This allows commands to be queued by reference, as well as by value. - Remove unnecessary
Clonetrait bounds fromStyledContent. - Add
StyledContent::style_mut. - Handle error correctly for
execute!andqueue!. - Fix minor syntax bug in
execute!andqueue!. - Change
ContentStyle::applyto take self by value instead of reference, to prevent an unnecessary extra clone. - Added basic trait implementations (
Debug,Clone,Copy, etc) to all of the command structs ResetColoruses&'static strinstead ofString
-
0.14.211 Jan 2020 -
0.14.117 Dec 2019Release notes
Open source →- Made windows cursor position relative to the window instead absolute to the screen buffer windows.
- Fix windows bug with
queuemacro were it consumed a type and required an type to beCopy.
-
0.14.013 Dec 2019Nothing published for this version
-
0.13.308 Nov 2019Release notes
Open source →- Remove thread from AsyncReader on Windows.
- Improve HANDLE management windows.
-
0.13.204 Nov 2019Release notes
Open source →- New
input::stop_reading_thread()function- Temporary workaround for the UNIX platform to stop the background reading thread and close the file descriptor
- This function will be removed in the next version
- New
-
0.13.104 Nov 2019Release notes
Open source →- Async Reader fix, join background thread and avoid looping forever on windows.
-
0.13.002 Nov 2019Release notes
Open source →Major API-change, removed old-api
- Remove
Crosstermtype - Remove
TerminalCursor,TerminalColor,Terminal - Remove
cursor(),color(),terminal() - Remove re-exports at root, accessible via
module::types(cursor::MoveTo) inputmodule- Derive 'Copy' for 'KeyEvent'
- Add the
EnableMouseCaptureandEnableMouseCapturecommands
cursormodule- Introduce static function
crossterm::cursor::positionin place ofTerminalCursor::pos - Rename
GototoMoveTo - Rename
UptoMoveLeft - Rename
RighttoMoveRight - Rename
DowntoMoveDown - Rename
BlinkOntoEnableBlinking - Rename
BlinkOfftoDisableBlinking - Rename
ResetPostoResetPosition - Rename
SavePostoSavePosition
- Introduce static function
terminal- Introduce static function
crossterm::terminal::sizein place ofTerminal::size - Introduce static function
crossterm::terminal::exitin place ofTerminal::exit
- Introduce static function
style module- Rename
ObjectStyletoContentStyle. Now full names are used for methods - Rename
StyledObjecttoStyledContentand made members private - Rename
PrintStyledFonttoPrintStyledContent - Rename
attrmethod toattribute. - Rename
Attribute::NoInversetoNoReverse - Update documentation
- Made
Coloredprivate, user should use commands instead - Rename
SetFg->SetForegroundColor - Rename
SetBg->SetBackgroundColor - Rename
SetAttr->SetAttribute - Rename
ContentStyle::fg_color->ContentStyle::foreground_color - Rename
ContentStyle::bg_color->ContentStyle::background_color - Rename
ContentStyle::attrs->ContentStyle::attributes
- Rename
- Improve documentation
- Unix terminal size calculation with TPUT
- Remove
-
0.12.122 Oct 2019Release notes
Open source →- Move all the
crossterm_crates code was moved to thecrosstermcratecrossterm_cursoris in thecursormodule, etc.- All these modules are public
- No public API breaking changes
- Move all the
-
0.12.021 Oct 2019Release notes
Open source →- Following crates are deprecated and no longer maintained
crossterm_cursorcrossterm_inputcrossterm_screencrossterm_stylecrossterm_terminalcrossterm_utils
crossterm_cursor0.4.0- Fix examples link (PR #6)
- Sync documentation style (PR #7)
- Remove all references to the crossterm book (PR #8)
- Replace
RAW_MODE_ENABLEDwithis_raw_mode_enabled(PR #9) - Use
SyncReader&InputEvent::CursorPositionforpos_raw()(PR #10)
crossterm_input0.5.0- Sync documentation style (PR #4)
- Sync
SyncReader::next()Windows and UNIX behavior (PR #5) - Remove all references to the crossterm book (PR #6)
- Mouse coordinates synchronized with the cursor (PR #7)
- Upper/left reported as
(0, 0)
- Upper/left reported as
- Fix bug that read sync didn't block (Windows) (PR #8)
- Refactor UNIX readers (PR #9)
- AsyncReader produces mouse events
- One reading thread per application, not per
AsyncReader - Cursor position no longer consumed by another
AsyncReader - Implement sync reader for read_char (requires raw mode)
- Fix
SIGTTINwhen executed under the LLDB - Add mio for reading from FD and more efficient polling (UNIX only)
- Sync UNIX and Windows vertical mouse position (PR #11)
- Top is always reported as
0
- Top is always reported as
crossterm_screen0.3.2to_alternateswitch back to main screen if it fails to switch into raw mode (PR #4)- Improve the documentation (PR #5)
- Public API
- Include the book content in the documentation
- Remove all references to the crossterm book (PR #6)
- New commands introduced (PR #7)
EnterAlternateScreenLeaveAlternateScreen
- Sync Windows and UNIX raw mode behavior (PR #8)
crossterm_style0.5.2- Refactor (PR #2)
- Added unit tests
- Improved documentation and added book page to
lib.rs - Fixed bug with
SetBgcommand, WinApi logic - Fixed bug with
StyledObject, used stdout for resetting terminal color - Introduced
ResetColorcommand
- Sync documentation style (PR #3)
- Remove all references to the crossterm book (PR #4)
- Windows 7 grey/white foreground/intensity swapped (PR #5)
crossterm_terminal0.3.2- Removed
crossterm_cursor::sysdependency (PR #2) - Internal refactoring & documentation (PR #3)
- Removed all references to the crossterm book (PR #4)
crossterm_utils0.4.0- Add deprecation note (PR #3)
- Remove all references to the crossterm book (PR #4)
- Remove unsafe static mut (PR #5)
sys::unix::RAW_MODE_ENABLEDreplaced withsys::unix::is_raw_mode_enabled()(breaking)- New
lazy_staticdependency
crossterm_winapi0.3.0- Make read sync block for windows systems (PR #2)
- Following crates are deprecated and no longer maintained
-
0.11.125 Sep 2019Release notes
Open source →- Maintenance release
- All sub-crates were moved to their own repositories in the
crossterm-rsorganization
-
0.11.024 Sep 2019Release notes
Open source →As a preparation for crossterm 0.1.0 we have moved crossterm to an organisation called 'crossterm-rs'.
Code Quality
- 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
- Examples: example-cleanup_1, example-cleanup_2, example-fix, commandbar-fix, snake-game-improved
- Fixed all broken tests and added tests
Important Changes
- Return written bytes: return-written-bytes
- Added derives:
DebugforObjectStyledebug-derive, Serialize/Deserialize for key events serde - Improved error handling:
- Return
crossterm::Resultfrom all api's: return_crossterm_resultTerminalCursor::pos()returnsResult<(u16, u16)>Terminal::size()returnsResult<(u16, u16)>TerminalCursor::move_*returnscrossterm::ResultExecutableCommand::queuereturnscrossterm::ResultQueueableCommand::queuereturnscrossterm::Resultget_available_color_countreturns no resultRawScreen::into_raw_modereturnscrossterm::Resultinstead ofio::ResultRawScreen::disable_raw_modereturnscrossterm::Resultinstead ofio::ResultAlternateScreen::to_alternatereturnscrossterm::Resultinstead ofio::ResultTerminalInput::read_linereturnscrossterm::Resultinstead ofio::ResultTerminalInput::read_charreturnscrossterm::Resultinstead ofio::Result- Maybe I forgot something, a lot of functions have changed
- Removed all unwraps/expects from library
- Return
- Add KeyEvent::Enter and KeyEvent::Tab: added-key-event-enter, added-key-event-tab
- Sync set/get terminal size behaviour: fixed-get-set-terminal-size
- Method renames:
AsyncReader::stop_reading()tostop()RawScreen::disable_raw_mode_on_droptokeep_raw_mode_on_dropTerminalCursor::reset_position()torestore_position()Command::get_anis_code()toansi_code()available_color_counttoavailable_color_count()Terminal::terminal_sizetoTerminal::sizeConsole::get_handletoConsole::handle
- All
i16values for indexing: set size, set cursor pos, scrolling synced tou16values - Command API takes mutable self instead of self
-
0.10.202 Aug 2019Nothing published for this version
-
0.10.126 Jul 2019Nothing published for this version
-
0.10.025 Jul 2019 withdrawn -
0.9.615 Jun 2019 -
0.9.520 May 2019 -
0.9.415 May 2019 -
0.9.319 Apr 2019Release notes
Open source →- Removed println from
SyncReader
Version 0.9.2
- Terminal size linux was not 0-based
- Windows mouse input event position was 0-based and should be 1-based
- Result, ErrorKind are made re-exported
- Fixed some special key combination detections for UNIX systems
- Made FreeBSD compile
Version 0.9.1
- Fixed libc compile error
Version 0.9.0 (yanked)
This release is all about moving to a stabilized API for 1.0.
- Major refactor and cleanup.
- Improved performance;
- No locking when writing to stdout.
- UNIX doesn't have any dynamic dispatch anymore.
- Windows has improved the way to check if ANSI modes are enabled.
- Removed lot's of complex API calls:
from_screen,from_output - Removed
Arc<TerminalOutput>from all internal Api's.
- Removed termios dependency for UNIX systems.
- Upgraded deps.
- Removed about 1000 lines of code
TerminalOutputScreen- unsafe code
- Some duplicated code introduced by a previous refactor.
- Raw modes UNIX systems improved
- Added
NoItalicattribute
Version 0.8.2
- Bug fix for sync reader UNIX.
Version 0.8.1
- Added public re-exports for input.
- Removed println from
-
0.9.217 Apr 2019Nothing published for this version
-
0.9.111 Apr 2019Nothing published for this version
-
0.9.010 Apr 2019 withdrawnNothing published for this version
-
0.8.205 Apr 2019Nothing published for this version
-
0.8.104 Apr 2019Nothing published for this version
-
0.8.002 Apr 2019Release notes
Open source →- Introduced KeyEvents
- Introduced MouseEvents
- Upgraded crossterm_winapi 0.2
-
0.7.021 Mar 2019Release notes
Open source →- Introduced more
Attributes - Introduced easier ways to style text issue 87.
- Removed
ColorTypesince it was unnecessary.
- Introduced more
-
0.6.027 Jan 2019Release notes
Open source →- Introduced feature flags; input, cursor, style, terminal, screen.
- All modules are moved to their own crate.
- Introduced crossterm workspace
- Less dependencies.
- Improved namespaces.
-
0.5.526 Jan 2019 -
0.5.408 Jan 2019 -
0.5.303 Jan 2019Nothing published for this version
-
0.5.203 Jan 2019 withdrawnNothing published for this version
-
0.5.128 Nov 2018