mirror of
https://github.com/nushell/nushell.git
synced 2025-08-16 14:31:02 +02:00
remove terminal_size
crate everywhere it makes sense (#14423)
# Description This PR removes the `terminal_size` crate everywhere that it made sense. I replaced it with crossterm's version called `size`. The places I didn't remove it were the places that did not have a dependency on crossterm. So, I thought it was "cheaper" to have a dep on term_size vs crossterm in those locations.
This commit is contained in:
@ -9,6 +9,7 @@ mod views;
|
||||
|
||||
use anyhow::Result;
|
||||
use commands::{ExpandCmd, HelpCmd, NuCmd, QuitCmd, TableCmd, TryCmd};
|
||||
use crossterm::terminal::size;
|
||||
pub use default_context::add_explore_context;
|
||||
pub use explore::Explore;
|
||||
use explore::ExploreConfig;
|
||||
@ -19,7 +20,6 @@ use nu_protocol::{
|
||||
};
|
||||
use pager::{Page, Pager, PagerConfig};
|
||||
use registry::CommandRegistry;
|
||||
use terminal_size::{Height, Width};
|
||||
use views::{BinaryView, Orientation, Preview, RecordView};
|
||||
|
||||
mod util {
|
||||
@ -80,7 +80,7 @@ fn create_record_view(
|
||||
}
|
||||
|
||||
if config.tail {
|
||||
if let Some((Width(w), Height(h))) = terminal_size::terminal_size() {
|
||||
if let Ok((w, h)) = size() {
|
||||
view.tail(w, h);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user