Skip to content

Commit f709e99

Browse files
committed
fix terminal_size sep
1 parent 341b942 commit f709e99

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ regex = "1.10.3"
3232
serde = {version = "1", features = ["derive"]}
3333
serde_json = "1"
3434
serde_tuple = "0.5.0"
35-
terminal_size = "0.3.0"
3635
thread_local = "1"
3736
time = "0.3.36"
3837
tinyvec = {version = "1", features = ["alloc", "serde"]}
@@ -48,6 +47,7 @@ rustls = {version = "0.23.2", optional = true, default-features = false, feature
4847
"tls12",
4948
"ring",
5049
]}
50+
terminal_size = {version = "0.3.0", optional = true}
5151
trash = {version = "4.0.0", optional = true}
5252
viuer = {version = "0.7.1", optional = true}
5353
webpki-roots = {version = "0.26.0", optional = true}
@@ -113,6 +113,7 @@ binary = [
113113
"native_sys",
114114
"ffi",
115115
"terminal-light",
116+
"terminal_size",
116117
]
117118
bytes = [] # No longer used
118119
clipboard = ["arboard"]

src/sys.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2483,5 +2483,10 @@ pub fn now() -> f64 {
24832483
}
24842484

24852485
pub(crate) fn terminal_size() -> Option<(usize, usize)> {
2486-
terminal_size::terminal_size().map(|(w, h)| (w.0 as usize, h.0 as usize))
2486+
#[cfg(all(not(target_arch = "wasm32"), feature = "terminal_size"))]
2487+
{
2488+
terminal_size::terminal_size().map(|(w, h)| (w.0 as usize, h.0 as usize))
2489+
}
2490+
#[cfg(target_arch = "wasm32")]
2491+
None
24872492
}

0 commit comments

Comments
 (0)