v0.2.10 : affichage ls/dir adapte a la largeur du terminal — detection de la largeur de la console (AM_TABLE_WIDTH pour tests), troncature de la colonne nom avec …, suppression des colonnes de fin si necessaire, une ligne par entree
This commit is contained in:
+3
-1
@@ -982,8 +982,10 @@ fn ls_target(rest: &[String]) -> Result<std::path::PathBuf> {
|
||||
}
|
||||
|
||||
/// Print a table and remember it as the last result (for where/get).
|
||||
/// The table is rendered to fit the terminal width so rows never wrap.
|
||||
fn show_table(app: &App, last: &mut Option<DataTable>, table: DataTable) {
|
||||
print!("{}", table.render(app.color()));
|
||||
let width = crate::output::terminal_width().unwrap_or(120);
|
||||
print!("{}", table.render(app.color(), width));
|
||||
*last = Some(table);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user