1[package]
2name = "crossterm"
3version = "0.27.0"
4authors = ["T. Post"]
5description = "A crossplatform terminal library for manipulating terminals."
6repository = "https://github.com/crossterm-rs/crossterm"
7documentation = "https://docs.rs/crossterm/"
8license = "MIT"
9keywords = ["event", "color", "cli", "input", "terminal"]
10exclude = ["target", "Cargo.lock"]
11readme = "README.md"
12edition = "2021"
13rust-version = "1.58.0"
14categories = ["command-line-interface", "command-line-utilities"]
15
16[lib]
17name = "crossterm"
18path = "src/lib.rs"
19
20#
21# Build documentation with all features -> EventStream is available
22#
23[package.metadata.docs.rs]
24all-features = true
25
26#
27# Features
28#
29[features]
30default = ["bracketed-paste", "windows", "events"]
31windows = ["dep:winapi", "dep:crossterm_winapi"] # Disables winapi dependencies from being included into the binary (SHOULD NOT be disabled on windows).
32bracketed-paste = [] # Enables triggering a `Event::Paste` when pasting text into the terminal.
33event-stream = ["dep:futures-core", "events"] # Enables async events
34use-dev-tty = ["filedescriptor"] # Enables raw file descriptor polling / selecting instead of mio.
35events = ["dep:mio", "dep:signal-hook", "dep:signal-hook-mio"] # Enables reading input/events from the system.
36serde = ["dep:serde", "bitflags/serde"] # Enables 'serde' for various types.
37
38#
39# Shared dependencies
40#
41[dependencies]
42bitflags = {version = "2.3" }
43parking_lot = "0.12"
44
45# optional deps only added when requested
46futures-core = { version = "0.3", optional = true, default-features = false }
47serde = { version = "1.0", features = ["derive"], optional = true }
48
49#
50# Windows dependencies
51#
52[target.'cfg(windows)'.dependencies.winapi]
53version = "0.3.9"
54features = ["winuser", "winerror"]
55optional = true
56
57[target.'cfg(windows)'.dependencies]
58crossterm_winapi = { version = "0.9.1", optional = true }
59
60#
61# UNIX dependencies
62#
63[target.'cfg(unix)'.dependencies]
64libc = "0.2"
65signal-hook = { version = "0.3.17", optional = true }
66filedescriptor = { version = "0.8", optional = true }
67mio = { version = "0.8", features = ["os-poll"], optional = true }
68signal-hook-mio = { version = "0.2.3", features = ["support-v0_8"], optional = true }
69
70#
71# Dev dependencies (examples, ...)
72#
73[dev-dependencies]
74tokio = { version = "1.25", features = ["full"] }
75futures = "0.3"
76futures-timer = "3.0"
77async-std = "1.12"
78serde_json = "1.0"
79serial_test = "2.0.0"
80
81#
82# Examples
83#
84[[example]]
85name = "event-read"
86required-features = ["bracketed-paste", "events"]
87
88[[example]]
89name = "event-match-modifiers"
90required-features = ["bracketed-paste", "events"]
91
92[[example]]
93name = "event-poll-read"
94required-features = ["bracketed-paste", "events"]
95
96[[example]]
97name = "event-stream-async-std"
98required-features = ["event-stream", "events"]
99
100[[example]]
101name = "event-stream-tokio"
102required-features = ["event-stream", "events"]
103
104[[example]]
105name = "event-read-char-line"
106required-features = ["events"]
107
108[[example]]
109name = "stderr"
110required-features = ["events"]
111