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:
2026-08-16 09:38:54 -04:00
parent 57234b7a38
commit e7cb136c38
6 changed files with 159 additions and 23 deletions
+3 -1
View File
@@ -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);
}