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 -2
View File
@@ -163,9 +163,10 @@ pub fn ls_table(path: &Path, color: bool) -> Result<DataTable> {
})
}
/// Render a Nushell-style boxed table of the entries of a path.
/// Render a Nushell-style boxed table of the entries of a path (unbounded
/// width — used by tests; the REPL renders with the terminal width).
pub fn render_ls(path: &Path, color: bool) -> Result<String> {
Ok(ls_table(path, color)?.render(color))
Ok(ls_table(path, color)?.render(color, 200))
}
/// Completion candidates for a path fragment typed after cd or ls.