Skip to content

Commit ecb5b5f

Browse files
authored
chore: rm dead code (#11796)
1 parent 957c9da commit ecb5b5f

File tree

4 files changed

+0
-44
lines changed

4 files changed

+0
-44
lines changed

Cargo.lock

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,6 @@ anstyle = "1.0"
283283
dialoguer = { version = "0.12", default-features = false, features = [
284284
"password",
285285
] }
286-
terminal_size = "0.4"
287286
clap_complete = "4"
288287
clap_complete_nushell = "4"
289288

crates/common/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ yansi.workspace = true
7272

7373
anstream.workspace = true
7474
anstyle.workspace = true
75-
terminal_size.workspace = true
7675
ciborium.workspace = true
7776

7877
flate2.workspace = true

crates/common/src/io/shell.rs

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -51,39 +51,6 @@ pub fn is_markdown() -> bool {
5151
/// The global shell instance.
5252
static GLOBAL_SHELL: OnceLock<Mutex<Shell>> = OnceLock::new();
5353

54-
/// Terminal width.
55-
pub enum TtyWidth {
56-
/// Not a terminal, or could not determine size.
57-
NoTty,
58-
/// A known width.
59-
Known(usize),
60-
/// A guess at the width.
61-
Guess(usize),
62-
}
63-
64-
impl TtyWidth {
65-
/// Returns the width of the terminal from the environment, if known.
66-
pub fn get() -> Self {
67-
// use stderr
68-
#[cfg(unix)]
69-
let opt = terminal_size::terminal_size_of(std::io::stderr());
70-
#[cfg(not(unix))]
71-
let opt = terminal_size::terminal_size();
72-
match opt {
73-
Some((w, _)) => Self::Known(w.0 as usize),
74-
None => Self::NoTty,
75-
}
76-
}
77-
78-
/// Returns the width used by progress bars for the tty.
79-
pub fn progress_max_width(&self) -> Option<usize> {
80-
match *self {
81-
Self::NoTty => None,
82-
Self::Known(width) | Self::Guess(width) => Some(width),
83-
}
84-
}
85-
}
86-
8754
#[derive(Debug, Default, Clone, Copy, PartialEq)]
8855
/// The requested output mode.
8956
pub enum OutputMode {
@@ -296,14 +263,6 @@ impl Shell {
296263
!self.needs_clear()
297264
}
298265

299-
/// Returns the width of the terminal in spaces, if any.
300-
pub fn err_width(&self) -> TtyWidth {
301-
match self.output {
302-
ShellOut::Stream { stderr_tty: true, .. } => TtyWidth::get(),
303-
_ => TtyWidth::NoTty,
304-
}
305-
}
306-
307266
/// Gets the output format of the shell.
308267
pub fn output_format(&self) -> OutputFormat {
309268
self.output_format

0 commit comments

Comments
 (0)