From f1e3e7c7ff1228f5ffb86eddb125d29a7ee5f871 Mon Sep 17 00:00:00 2001 From: Benjamin Sago Date: Sat, 24 Oct 2020 18:03:36 +0100 Subject: [PATCH 1/5] Move icon generation into file name module This commit makes adding icons to file names something that the file name renderer does, rather than something that each individual view does. This is now possible thanks to the previous commit a1869f2, which moved the option to do this into the same module. The repeated code has been removed. It happens to fix a bug where the width of each column was being incorrectly calculated for the grid-details view, making lines slightly too long for the terminal because the icon wasn't being taken into account. --- src/output/details.rs | 26 +++++------------- src/output/file_name.rs | 9 +++++++ src/output/grid.rs | 16 ++--------- src/output/grid_details.rs | 16 ++--------- src/output/icons.rs | 36 +++++++++---------------- src/output/lines.rs | 17 +++--------- xtests/outputs/files_grid_icons.ansitxt | 13 ++++----- 7 files changed, 43 insertions(+), 90 deletions(-) diff --git a/src/output/details.rs b/src/output/details.rs index 10f2404..1d029ec 100644 --- a/src/output/details.rs +++ b/src/output/details.rs @@ -65,7 +65,7 @@ use std::mem::MaybeUninit; use std::path::PathBuf; use std::vec::IntoIter as VecIntoIter; -use ansi_term::{ANSIGenericString, Style}; +use ansi_term::Style; use scoped_threadpool::Pool; use crate::fs::{Dir, File}; @@ -74,7 +74,6 @@ use crate::fs::feature::git::GitCache; use crate::fs::feature::xattr::{Attribute, FileAttributes}; use crate::fs::filter::FileFilter; use crate::output::cell::TextCell; -use crate::output::icons::painted_icon; use crate::output::file_name::Options as FileStyle; use crate::output::table::{Table, Options as TableOptions, Row as TableRow}; use crate::output::tree::{TreeTrunk, TreeParams, TreeDepth}; @@ -137,7 +136,6 @@ struct Egg<'a> { errors: Vec<(io::Error, Option)>, dir: Option, file: &'a File<'a>, - icon: Option, } impl<'a> AsRef> for Egg<'a> { @@ -266,10 +264,7 @@ impl<'a> Render<'a> { } }; - let icon = if self.file_style.icons { Some(painted_icon(file, self.theme)) } - else { None }; - - let egg = Egg { table_row, xattrs, errors, dir, file, icon }; + let egg = Egg { table_row, xattrs, errors, dir, file }; unsafe { std::ptr::write(file_eggs.lock().unwrap()[idx].as_mut_ptr(), egg) } }); } @@ -287,22 +282,15 @@ impl<'a> Render<'a> { t.add_widths(row); } - let mut name_cell = TextCell::default(); - if let Some(icon) = egg.icon { - name_cell.push(ANSIGenericString::from(icon), 2) - } - - let style = self.file_style.for_file(egg.file, self.theme) - .with_link_paths() - .paint() - .promote(); - name_cell.append(style); - + let file_name = self.file_style.for_file(egg.file, self.theme) + .with_link_paths() + .paint() + .promote(); let row = Row { tree: tree_params, cells: egg.table_row, - name: name_cell, + name: file_name, }; rows.push(row); diff --git a/src/output/file_name.rs b/src/output/file_name.rs index 70bdca8..b3b81e1 100644 --- a/src/output/file_name.rs +++ b/src/output/file_name.rs @@ -6,6 +6,7 @@ use ansi_term::{ANSIString, Style}; use crate::fs::{File, FileTarget}; use crate::output::cell::TextCellContents; use crate::output::escape; +use crate::output::icons::{icon_for_file, iconify_style}; use crate::output::render::FiletypeColours; @@ -111,6 +112,14 @@ impl<'a, 'dir, C: Colours> FileName<'a, 'dir, C> { pub fn paint(&self) -> TextCellContents { let mut bits = Vec::new(); + if self.options.icons { + let style = iconify_style(self.colours.colour_file(self.file)); + let file_icon = icon_for_file(self.file).to_string(); + + bits.push(style.paint(file_icon)); + bits.push(Style::default().paint(" ")); + } + if self.file.parent_dir.is_none() { if let Some(parent) = self.file.path.parent() { self.add_parent_bits(&mut bits, parent); diff --git a/src/output/grid.rs b/src/output/grid.rs index 79d03db..952d909 100644 --- a/src/output/grid.rs +++ b/src/output/grid.rs @@ -3,9 +3,7 @@ use std::io::{self, Write}; use term_grid as tg; use crate::fs::File; -use crate::output::cell::DisplayWidth; use crate::output::file_name::Options as FileStyle; -use crate::output::icons::painted_icon; use crate::theme::Theme; @@ -40,17 +38,11 @@ impl<'a> Render<'a> { grid.reserve(self.files.len()); for file in &self.files { - let icon = if self.file_style.icons { Some(painted_icon(file, self.theme)) } - else { None }; - let filename = self.file_style.for_file(file, self.theme).paint(); - let width = if self.file_style.icons { DisplayWidth::from(2) + filename.width() } - else { filename.width() }; - grid.add(tg::Cell { - contents: format!("{}{}", &icon.unwrap_or_default(), filename.strings()), - width: *width, + contents: filename.strings().to_string(), + width: *filename.width(), }); } @@ -62,10 +54,6 @@ impl<'a> Render<'a> { // This isn’t *quite* the same as the lines view, which also // displays full link paths. for file in &self.files { - if self.file_style.icons { - write!(w, "{}", painted_icon(file, self.theme))?; - } - let name_cell = self.file_style.for_file(file, self.theme).paint(); writeln!(w, "{}", name_cell.strings())?; } diff --git a/src/output/grid_details.rs b/src/output/grid_details.rs index c1a1203..ba157c3 100644 --- a/src/output/grid_details.rs +++ b/src/output/grid_details.rs @@ -2,7 +2,7 @@ use std::io::{self, Write}; -use ansi_term::{ANSIGenericString, ANSIStrings}; +use ansi_term::ANSIStrings; use term_grid as grid; use crate::fs::{Dir, File}; @@ -13,7 +13,6 @@ use crate::output::cell::TextCell; use crate::output::details::{Options as DetailsOptions, Row as DetailsRow, Render as DetailsRender}; use crate::output::file_name::Options as FileStyle; use crate::output::grid::Options as GridOptions; -use crate::output::icons::painted_icon; use crate::output::table::{Table, Row as TableRow, Options as TableOptions}; use crate::output::tree::{TreeParams, TreeDepth}; use crate::theme::Theme; @@ -155,18 +154,7 @@ impl<'a> Render<'a> { .collect::>(); let file_names = self.files.iter() - .map(|file| { - if self.file_style.icons { - let mut icon_cell = TextCell::default(); - icon_cell.push(ANSIGenericString::from(painted_icon(file, self.theme)), 2); - let file_cell = self.file_style.for_file(file, self.theme).paint().promote(); - icon_cell.append(file_cell); - icon_cell - } - else { - self.file_style.for_file(file, self.theme).paint().promote() - } - }) + .map(|file| self.file_style.for_file(file, self.theme).paint().promote()) .collect::>(); let mut last_working_table = self.make_grid(1, options, &file_names, rows.clone(), &drender); diff --git a/src/output/icons.rs b/src/output/icons.rs index 99df9fc..20e243a 100644 --- a/src/output/icons.rs +++ b/src/output/icons.rs @@ -2,7 +2,6 @@ use ansi_term::Style; use crate::fs::File; use crate::info::filetype::FileExtensions; -use crate::theme::Theme; pub trait FileIcon { @@ -28,33 +27,24 @@ impl Icons { } -pub fn painted_icon(file: &File<'_>, theme: &Theme) -> String { - use crate::output::file_name::Colours; - - let file_icon = icon(file).to_string(); - let c = theme.colour_file(file); - - // Remove underline from icon - let painted = - if c.is_underline { - match c.foreground { - Some(color) => { - Style::from(color).paint(file_icon).to_string() - } - None => { - Style::default().paint(file_icon).to_string() - } +pub fn iconify_style<'a>(style: Style) -> Style { + if style.is_underline { + match style.foreground { + Some(color) => { + Style::from(color) + } + None => { + Style::default() } } - else { - c.paint(file_icon).to_string() - }; - - format!("{} ", painted) + } + else { + style + } } -fn icon(file: &File<'_>) -> char { +pub fn icon_for_file(file: &File<'_>) -> char { let extensions = Box::new(FileExtensions); if file.points_to_directory() { diff --git a/src/output/lines.rs b/src/output/lines.rs index 5b492ca..9304a84 100644 --- a/src/output/lines.rs +++ b/src/output/lines.rs @@ -1,11 +1,10 @@ use std::io::{self, Write}; -use ansi_term::{ANSIStrings, ANSIGenericString}; +use ansi_term::ANSIStrings; use crate::fs::File; -use crate::output::cell::{TextCell, TextCellContents}; +use crate::output::cell::TextCellContents; use crate::output::file_name::{Options as FileStyle}; -use crate::output::icons::painted_icon; use crate::theme::Theme; @@ -20,17 +19,7 @@ impl<'a> Render<'a> { pub fn render(&self, w: &mut W) -> io::Result<()> { for file in &self.files { let name_cell = self.render_file(file); - if self.file_style.icons { - // Create a TextCell for the icon then append the text to it - let mut cell = TextCell::default(); - let icon = painted_icon(file, self.theme); - cell.push(ANSIGenericString::from(icon), 2); - cell.append(name_cell.promote()); - writeln!(w, "{}", ANSIStrings(&cell))?; - } - else { - writeln!(w, "{}", ANSIStrings(&name_cell))?; - } + writeln!(w, "{}", ANSIStrings(&name_cell))?; } Ok(()) diff --git a/xtests/outputs/files_grid_icons.ansitxt b/xtests/outputs/files_grid_icons.ansitxt index c8667ff..b686046 100644 --- a/xtests/outputs/files_grid_icons.ansitxt +++ b/xtests/outputs/files_grid_icons.ansitxt @@ -1,6 +1,7 @@ - 1_bytes  3_bytes  5_bytes  7_bytes  9_bytes  11_bytes  13_bytes - 1_KiB  3_KiB  5_KiB  7_KiB  9_KiB  11_KiB  13_KiB - 1_MiB  3_MiB  5_MiB  7_MiB  9_MiB  11_MiB  13_MiB - 2_bytes  4_bytes  6_bytes  8_bytes  10_bytes  12_bytes - 2_KiB  4_KiB  6_KiB  8_KiB  10_KiB  12_KiB - 2_MiB  4_MiB  6_MiB  8_MiB  10_MiB  12_MiB + 1_bytes  3_KiB  5_MiB  8_bytes  10_KiB  12_MiB + 1_KiB  3_MiB  6_bytes  8_KiB  10_MiB  13_bytes + 1_MiB  4_bytes  6_KiB  8_MiB  11_bytes  13_KiB + 2_bytes  4_KiB  6_MiB  9_bytes  11_KiB  13_MiB + 2_KiB  4_MiB  7_bytes  9_KiB  11_MiB + 2_MiB  5_bytes  7_KiB  9_MiB  12_bytes + 3_bytes  5_KiB  7_MiB  10_bytes  12_KiB From 67a6cdd46a35cb5f470d374b3e90b8d6cb42b3a2 Mon Sep 17 00:00:00 2001 From: Benjamin Sago Date: Sat, 24 Oct 2020 18:16:38 +0100 Subject: [PATCH 2/5] Make icon styles appropriate for all file types exa now bases the icon style for a file on its file name and kind in all cases, rather than just on its file name. This means that directories and symlinks have the correctly-coloured icon. It also only takes the foreground colour into account while styling the icon, to make sure they're not bold or underlined. Fixes GH-528. --- src/output/file_name.rs | 2 +- src/output/icons.rs | 16 +++------------- 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/src/output/file_name.rs b/src/output/file_name.rs index b3b81e1..ff61035 100644 --- a/src/output/file_name.rs +++ b/src/output/file_name.rs @@ -113,7 +113,7 @@ impl<'a, 'dir, C: Colours> FileName<'a, 'dir, C> { let mut bits = Vec::new(); if self.options.icons { - let style = iconify_style(self.colours.colour_file(self.file)); + let style = iconify_style(self.style()); let file_icon = icon_for_file(self.file).to_string(); bits.push(style.paint(file_icon)); diff --git a/src/output/icons.rs b/src/output/icons.rs index 20e243a..7b9676d 100644 --- a/src/output/icons.rs +++ b/src/output/icons.rs @@ -28,19 +28,9 @@ impl Icons { pub fn iconify_style<'a>(style: Style) -> Style { - if style.is_underline { - match style.foreground { - Some(color) => { - Style::from(color) - } - None => { - Style::default() - } - } - } - else { - style - } + style.foreground + .map(Style::from) + .unwrap_or_default() } From 976db01b3e93aa537e1a682e61a8e02febfa6cad Mon Sep 17 00:00:00 2001 From: Benjamin Sago Date: Sat, 24 Oct 2020 18:29:28 +0100 Subject: [PATCH 3/5] Prefer background colour when painting icons The rationale here is that there's more of a background colour than the foreground colour when painting text, and having a gap of no background colour in between the icon and the file name looks weird. Fixes GH-561. --- src/output/icons.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/output/icons.rs b/src/output/icons.rs index 7b9676d..09b285a 100644 --- a/src/output/icons.rs +++ b/src/output/icons.rs @@ -27,8 +27,16 @@ impl Icons { } +/// Converts the style used to paint a file name into the style that should be +/// used to paint an icon. +/// +/// - The background colour should be preferred to the foreground colour, as +/// if one is set, it’s the more “obvious” colour choice. +/// - If neither is set, just use the default style. +/// - Attributes such as bold or underline should not be used to paint the +/// icon, as they can make it look weird. pub fn iconify_style<'a>(style: Style) -> Style { - style.foreground + style.background.or(style.foreground) .map(Style::from) .unwrap_or_default() } From c83359225b3037483aeb96d7562cd7bc8de6c0b8 Mon Sep 17 00:00:00 2001 From: Benjamin Sago Date: Sat, 24 Oct 2020 18:43:59 +0100 Subject: [PATCH 4/5] Fix xtests for previous two commits --- xtests/outputs/files_long_tree_icons.ansitxt | 2 +- xtests/outputs/files_tree_icons.ansitxt | 2 +- xtests/outputs/links_oneline_icons.ansitxt | 18 +++++++++--------- .../outputs/permissions_oneline_icons.ansitxt | 12 ++++++------ 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/xtests/outputs/files_long_tree_icons.ansitxt b/xtests/outputs/files_long_tree_icons.ansitxt index d009a86..0c8b18d 100644 --- a/xtests/outputs/files_long_tree_icons.ansitxt +++ b/xtests/outputs/files_long_tree_icons.ansitxt @@ -1,4 +1,4 @@ -drwxrwxr-x - vagrant 18 Oct 00:18  /testcases/files +drwxrwxr-x - vagrant 18 Oct 00:18  /testcases/files .rw-r--r-- 1 cassowary  1 Jan 12:34 ├──  1_bytes .rw-r--r-- 1.0k cassowary  1 Jan 12:34 ├──  1_KiB .rw-r--r-- 1.0M cassowary  1 Jan 12:34 ├──  1_MiB diff --git a/xtests/outputs/files_tree_icons.ansitxt b/xtests/outputs/files_tree_icons.ansitxt index f84285c..ecd5d32 100644 --- a/xtests/outputs/files_tree_icons.ansitxt +++ b/xtests/outputs/files_tree_icons.ansitxt @@ -1,4 +1,4 @@ - /testcases/files + /testcases/files ├──  1_bytes ├──  1_KiB ├──  1_MiB diff --git a/xtests/outputs/links_oneline_icons.ansitxt b/xtests/outputs/links_oneline_icons.ansitxt index dc0fdd9..914aa12 100644 --- a/xtests/outputs/links_oneline_icons.ansitxt +++ b/xtests/outputs/links_oneline_icons.ansitxt @@ -1,10 +1,10 @@ - broken -> nowhere - current_dir -> . - forbidden -> /proc/1/root - itself -> itself - parent_dir -> .. - root -> / + broken -> nowhere + current_dir -> . + forbidden -> /proc/1/root + itself -> itself + parent_dir -> .. + root -> /  some_file - some_file_absolute -> /testcases/links/some_file - some_file_relative -> some_file - usr -> /usr + some_file_absolute -> /testcases/links/some_file + some_file_relative -> some_file + usr -> /usr diff --git a/xtests/outputs/permissions_oneline_icons.ansitxt b/xtests/outputs/permissions_oneline_icons.ansitxt index bfb717c..34cded0 100644 --- a/xtests/outputs/permissions_oneline_icons.ansitxt +++ b/xtests/outputs/permissions_oneline_icons.ansitxt @@ -5,18 +5,18 @@  010  020  040 - 100 + 100  200  400  644 - 755 - 777 + 755 + 777  1000  1001  2000  2010  4000 - 4100 + 4100  7666 - 7777 - forbidden-directory + 7777 + forbidden-directory From 51be9f4c43e61bbea61e70e1459e494207d1d979 Mon Sep 17 00:00:00 2001 From: Benjamin Sago Date: Sat, 24 Oct 2020 19:39:22 +0100 Subject: [PATCH 5/5] Introduce EXA_ICON_SPACING environment variable This commit remove the extra space that was added between icons and file names in commit 128fadd, and adds an option to put them back. Re-fixes GH-619 and fixes GH-541. --- man/exa.1.md | 6 ++ src/options/file_name.rs | 26 +++++- src/options/vars.rs | 6 ++ src/options/view.rs | 2 +- src/output/file_name.rs | 32 +++++++- xtests/icons.toml | 35 ++++++++ xtests/outputs/exts_oneline_icons.ansitxt | 52 ++++++------ xtests/outputs/files_grid_icons.ansitxt | 13 ++- xtests/outputs/files_long_grid_icons.ansitxt | 78 +++++++++--------- xtests/outputs/files_long_icons.ansitxt | 78 +++++++++--------- xtests/outputs/files_long_tree_icons.ansitxt | 80 +++++++++---------- xtests/outputs/files_oneline_icons.ansitxt | 78 +++++++++--------- xtests/outputs/files_tree_icons.ansitxt | 80 +++++++++---------- xtests/outputs/links_oneline_icons.ansitxt | 20 ++--- .../links_oneline_icons_width0.ansitxt | 10 +++ .../links_oneline_icons_width2.ansitxt | 10 +++ .../links_oneline_icons_width3.ansitxt | 10 +++ .../outputs/permissions_oneline_icons.ansitxt | 44 +++++----- 18 files changed, 389 insertions(+), 271 deletions(-) create mode 100644 xtests/outputs/links_oneline_icons_width0.ansitxt create mode 100644 xtests/outputs/links_oneline_icons_width2.ansitxt create mode 100644 xtests/outputs/links_oneline_icons_width3.ansitxt diff --git a/man/exa.1.md b/man/exa.1.md index 5525b93..a0a97de 100644 --- a/man/exa.1.md +++ b/man/exa.1.md @@ -208,6 +208,12 @@ Limits the grid-details view (‘`exa --grid --long`’) so it’s only activate With widescreen displays, it’s possible for the grid to look very wide and sparse, on just one or two lines with none of the columns lining up. By specifying a minimum number of rows, you can only use the view if it’s going to be worth using. +## `EXA_ICON_SPACING` + +Specifies the number of spaces to print between an icon (see the ‘`--icons`’ option) and its file name. + +Different terminals display icons differently, as they usually take up more than one character width on screen, so there’s no “standard” number of spaces that exa can use to separate an icon from text. One space may place the icon too close to the text, and two spaces may place it too far away. So the choice is left up to the user to configure depending on their terminal emulator. + ## `LS_COLORS`, `EXA_COLORS` Specifies the colour scheme used to highlight files based on their name and kind, as well as highlighting metadata and parts of the UI. diff --git a/src/options/file_name.rs b/src/options/file_name.rs index 283562a..d29f454 100644 --- a/src/options/file_name.rs +++ b/src/options/file_name.rs @@ -1,15 +1,16 @@ use crate::options::{flags, OptionsError}; use crate::options::parser::MatchedFlags; +use crate::options::vars::{self, Vars}; -use crate::output::file_name::{Options, Classify}; +use crate::output::file_name::{Options, Classify, ShowIcons}; impl Options { - pub fn deduce(matches: &MatchedFlags<'_>) -> Result { + pub fn deduce(matches: &MatchedFlags<'_>, vars: &V) -> Result { let classify = Classify::deduce(matches)?; - let icons = matches.has(&flags::ICONS)?; + let show_icons = ShowIcons::deduce(matches, vars)?; - Ok(Self { classify, icons }) + Ok(Self { classify, show_icons }) } } @@ -21,3 +22,20 @@ impl Classify { else { Ok(Self::JustFilenames) } } } + +impl ShowIcons { + pub fn deduce(matches: &MatchedFlags<'_>, vars: &V) -> Result { + if ! matches.has(&flags::ICONS)? { + Ok(Self::Off) + } + else if let Some(columns) = vars.get(vars::EXA_ICON_SPACING).and_then(|s| s.into_string().ok()) { + match columns.parse() { + Ok(width) => Ok(Self::On(width)), + Err(e) => Err(OptionsError::FailedParse(e)), + } + } + else { + Ok(Self::On(1)) + } + } +} diff --git a/src/options/vars.rs b/src/options/vars.rs index 8c87332..a8fc40e 100644 --- a/src/options/vars.rs +++ b/src/options/vars.rs @@ -39,6 +39,12 @@ pub static EXA_DEBUG: &str = "EXA_DEBUG"; /// number of rows of output. pub static EXA_GRID_ROWS: &str = "EXA_GRID_ROWS"; +/// Environment variable used to specify how many spaces to print between an +/// icon and its file name. Different terminals display icons differently, +/// with 1 space bringing them too close together or 2 spaces putting them too +/// far apart, so this may be necessary depending on how they are shown. +pub static EXA_ICON_SPACING: &str = "EXA_ICON_SPACING"; + /// Mockable wrapper for `std::env::var_os`. pub trait Vars { diff --git a/src/options/view.rs b/src/options/view.rs index bb97286..9ad42ae 100644 --- a/src/options/view.rs +++ b/src/options/view.rs @@ -12,7 +12,7 @@ impl View { pub fn deduce(matches: &MatchedFlags<'_>, vars: &V) -> Result { let mode = Mode::deduce(matches, vars)?; let width = TerminalWidth::deduce(vars)?; - let file_style = FileStyle::deduce(matches)?; + let file_style = FileStyle::deduce(matches, vars)?; Ok(Self { mode, width, file_style }) } } diff --git a/src/output/file_name.rs b/src/output/file_name.rs index ff61035..bcd4b47 100644 --- a/src/output/file_name.rs +++ b/src/output/file_name.rs @@ -18,7 +18,7 @@ pub struct Options { pub classify: Classify, /// Whether to prepend icon characters before file names. - pub icons: bool, + pub show_icons: ShowIcons, } impl Options { @@ -72,6 +72,19 @@ impl Default for Classify { } +/// Whether and how to show icons. +#[derive(PartialEq, Debug, Copy, Clone)] +pub enum ShowIcons { + + /// Don’t show icons at all. + Off, + + /// Show icons next to file names, with the given number of spaces between + /// the icon and the file name. + On(u32), +} + + /// A **file name** holds all the information necessary to display the name /// of the given file. This is used in all of the views. pub struct FileName<'a, 'dir, C> { @@ -112,12 +125,17 @@ impl<'a, 'dir, C: Colours> FileName<'a, 'dir, C> { pub fn paint(&self) -> TextCellContents { let mut bits = Vec::new(); - if self.options.icons { + if let ShowIcons::On(spaces_count) = self.options.show_icons { let style = iconify_style(self.style()); let file_icon = icon_for_file(self.file).to_string(); bits.push(style.paint(file_icon)); - bits.push(Style::default().paint(" ")); + + match spaces_count { + 1 => bits.push(Style::default().paint(" ")), + 2 => bits.push(Style::default().paint(" ")), + n => bits.push(Style::default().paint(spaces(n))), + } } if self.file.parent_dir.is_none() { @@ -152,7 +170,7 @@ impl<'a, 'dir, C: Colours> FileName<'a, 'dir, C> { if ! target.name.is_empty() { let target_options = Options { classify: Classify::JustFilenames, - icons: false, + show_icons: ShowIcons::Off, }; let target = FileName { @@ -320,3 +338,9 @@ pub trait Colours: FiletypeColours { fn colour_file(&self, file: &File<'_>) -> Style; } + + +/// Generate a string made of `n` spaces. +fn spaces(width: u32) -> String { + (0 .. width).into_iter().map(|_| ' ').collect() +} diff --git a/xtests/icons.toml b/xtests/icons.toml index d0d6f66..6a1029d 100644 --- a/xtests/icons.toml +++ b/xtests/icons.toml @@ -77,3 +77,38 @@ stdout = { file = "outputs/links_oneline_icons.ansitxt" } stderr = { empty = true } status = 0 tags = [ 'oneline', 'icons' ] + + +# icon spacing tests + +[[cmd]] +name = "‘EXA_ICON_SPACING=0 exa -1 --icons’ puts no spaces between icons and file names" +shell = "EXA_ICON_SPACING=0 exa -1 --icons /testcases/links" +stdout = { file = "outputs/links_oneline_icons_width0.ansitxt" } +stderr = { empty = true } +status = 0 +tags = [ 'env', 'oneline', 'icons' ] + +[[cmd]] +name = "‘EXA_ICON_SPACING=1 exa -1 --icons’ puts one space between icons and file names" +shell = "EXA_ICON_SPACING=1 exa -1 --icons /testcases/links" +stdout = { file = "outputs/links_oneline_icons.ansitxt" } # same as the default +stderr = { empty = true } +status = 0 +tags = [ 'env', 'oneline', 'icons' ] + +[[cmd]] +name = "‘EXA_ICON_SPACING=2 exa -1 --icons’ puts two spaces between icons and file names" +shell = "EXA_ICON_SPACING=2 exa -1 --icons /testcases/links" +stdout = { file = "outputs/links_oneline_icons_width2.ansitxt" } +stderr = { empty = true } +status = 0 +tags = [ 'env', 'oneline', 'icons' ] + +[[cmd]] +name = "‘EXA_ICON_SPACING=3 exa -1 --icons’ puts three spaces between icons and file names" +shell = "EXA_ICON_SPACING=3 exa -1 --icons /testcases/links" +stdout = { file = "outputs/links_oneline_icons_width3.ansitxt" } +stderr = { empty = true } +status = 0 +tags = [ 'env', 'oneline', 'icons' ] diff --git a/xtests/outputs/exts_oneline_icons.ansitxt b/xtests/outputs/exts_oneline_icons.ansitxt index 54a4734..fa484ef 100644 --- a/xtests/outputs/exts_oneline_icons.ansitxt +++ b/xtests/outputs/exts_oneline_icons.ansitxt @@ -1,26 +1,26 @@ - #SAVEFILE# - backup~ - compiled.class - compiled.coffee - compiled.js - compiled.o - compressed.deb - compressed.tar.gz - compressed.tar.xz - compressed.tgz - compressed.txz - COMPRESSED.ZIP - crypto.asc - crypto.signature - document.pdf - DOCUMENT.XLSX - file.tmp - IMAGE.PNG - image.svg - lossless.flac - lossless.wav - Makefile - music.mp3 - MUSIC.OGG - VIDEO.AVI - video.wmv + #SAVEFILE# + backup~ + compiled.class + compiled.coffee + compiled.js + compiled.o + compressed.deb + compressed.tar.gz + compressed.tar.xz + compressed.tgz + compressed.txz + COMPRESSED.ZIP + crypto.asc + crypto.signature + document.pdf + DOCUMENT.XLSX + file.tmp + IMAGE.PNG + image.svg + lossless.flac + lossless.wav + Makefile + music.mp3 + MUSIC.OGG + VIDEO.AVI + video.wmv diff --git a/xtests/outputs/files_grid_icons.ansitxt b/xtests/outputs/files_grid_icons.ansitxt index b686046..ce58378 100644 --- a/xtests/outputs/files_grid_icons.ansitxt +++ b/xtests/outputs/files_grid_icons.ansitxt @@ -1,7 +1,6 @@ - 1_bytes  3_KiB  5_MiB  8_bytes  10_KiB  12_MiB - 1_KiB  3_MiB  6_bytes  8_KiB  10_MiB  13_bytes - 1_MiB  4_bytes  6_KiB  8_MiB  11_bytes  13_KiB - 2_bytes  4_KiB  6_MiB  9_bytes  11_KiB  13_MiB - 2_KiB  4_MiB  7_bytes  9_KiB  11_MiB - 2_MiB  5_bytes  7_KiB  9_MiB  12_bytes - 3_bytes  5_KiB  7_MiB  10_bytes  12_KiB + 1_bytes  3_bytes  5_bytes  7_bytes  9_bytes  11_bytes  13_bytes + 1_KiB  3_KiB  5_KiB  7_KiB  9_KiB  11_KiB  13_KiB + 1_MiB  3_MiB  5_MiB  7_MiB  9_MiB  11_MiB  13_MiB + 2_bytes  4_bytes  6_bytes  8_bytes  10_bytes  12_bytes + 2_KiB  4_KiB  6_KiB  8_KiB  10_KiB  12_KiB + 2_MiB  4_MiB  6_MiB  8_MiB  10_MiB  12_MiB diff --git a/xtests/outputs/files_long_grid_icons.ansitxt b/xtests/outputs/files_long_grid_icons.ansitxt index 01c102b..5807ff1 100644 --- a/xtests/outputs/files_long_grid_icons.ansitxt +++ b/xtests/outputs/files_long_grid_icons.ansitxt @@ -1,39 +1,39 @@ -.rw-r--r-- 1 cassowary  1 Jan 12:34  1_bytes -.rw-r--r-- 1.0k cassowary  1 Jan 12:34  1_KiB -.rw-r--r-- 1.0M cassowary  1 Jan 12:34  1_MiB -.rw-r--r-- 2 cassowary  1 Jan 12:34  2_bytes -.rw-r--r-- 2.0k cassowary  1 Jan 12:34  2_KiB -.rw-r--r-- 2.1M cassowary  1 Jan 12:34  2_MiB -.rw-r--r-- 3 cassowary  1 Jan 12:34  3_bytes -.rw-r--r-- 3.1k cassowary  1 Jan 12:34  3_KiB -.rw-r--r-- 3.1M cassowary  1 Jan 12:34  3_MiB -.rw-r--r-- 4 cassowary  1 Jan 12:34  4_bytes -.rw-r--r-- 4.1k cassowary  1 Jan 12:34  4_KiB -.rw-r--r-- 4.2M cassowary  1 Jan 12:34  4_MiB -.rw-r--r-- 5 cassowary  1 Jan 12:34  5_bytes -.rw-r--r-- 5.1k cassowary  1 Jan 12:34  5_KiB -.rw-r--r-- 5.2M cassowary  1 Jan 12:34  5_MiB -.rw-r--r-- 6 cassowary  1 Jan 12:34  6_bytes -.rw-r--r-- 6.1k cassowary  1 Jan 12:34  6_KiB -.rw-r--r-- 6.3M cassowary  1 Jan 12:34  6_MiB -.rw-r--r-- 7 cassowary  1 Jan 12:34  7_bytes -.rw-r--r-- 7.2k cassowary  1 Jan 12:34  7_KiB -.rw-r--r-- 7.3M cassowary  1 Jan 12:34  7_MiB -.rw-r--r-- 8 cassowary  1 Jan 12:34  8_bytes -.rw-r--r-- 8.2k cassowary  1 Jan 12:34  8_KiB -.rw-r--r-- 8.4M cassowary  1 Jan 12:34  8_MiB -.rw-r--r-- 9 cassowary  1 Jan 12:34  9_bytes -.rw-r--r-- 9.2k cassowary  1 Jan 12:34  9_KiB -.rw-r--r-- 9.4M cassowary  1 Jan 12:34  9_MiB -.rw-r--r-- 10 cassowary  1 Jan 12:34  10_bytes -.rw-r--r-- 10k cassowary  1 Jan 12:34  10_KiB -.rw-r--r-- 10M cassowary  1 Jan 12:34  10_MiB -.rw-r--r-- 11 cassowary  1 Jan 12:34  11_bytes -.rw-r--r-- 11k cassowary  1 Jan 12:34  11_KiB -.rw-r--r-- 11M cassowary  1 Jan 12:34  11_MiB -.rw-r--r-- 12 cassowary  1 Jan 12:34  12_bytes -.rw-r--r-- 12k cassowary  1 Jan 12:34  12_KiB -.rw-r--r-- 12M cassowary  1 Jan 12:34  12_MiB -.rw-r--r-- 13 cassowary  1 Jan 12:34  13_bytes -.rw-r--r-- 13k cassowary  1 Jan 12:34  13_KiB -.rw-r--r-- 13M cassowary  1 Jan 12:34  13_MiB +.rw-r--r-- 1 cassowary  1 Jan 12:34  1_bytes +.rw-r--r-- 1.0k cassowary  1 Jan 12:34  1_KiB +.rw-r--r-- 1.0M cassowary  1 Jan 12:34  1_MiB +.rw-r--r-- 2 cassowary  1 Jan 12:34  2_bytes +.rw-r--r-- 2.0k cassowary  1 Jan 12:34  2_KiB +.rw-r--r-- 2.1M cassowary  1 Jan 12:34  2_MiB +.rw-r--r-- 3 cassowary  1 Jan 12:34  3_bytes +.rw-r--r-- 3.1k cassowary  1 Jan 12:34  3_KiB +.rw-r--r-- 3.1M cassowary  1 Jan 12:34  3_MiB +.rw-r--r-- 4 cassowary  1 Jan 12:34  4_bytes +.rw-r--r-- 4.1k cassowary  1 Jan 12:34  4_KiB +.rw-r--r-- 4.2M cassowary  1 Jan 12:34  4_MiB +.rw-r--r-- 5 cassowary  1 Jan 12:34  5_bytes +.rw-r--r-- 5.1k cassowary  1 Jan 12:34  5_KiB +.rw-r--r-- 5.2M cassowary  1 Jan 12:34  5_MiB +.rw-r--r-- 6 cassowary  1 Jan 12:34  6_bytes +.rw-r--r-- 6.1k cassowary  1 Jan 12:34  6_KiB +.rw-r--r-- 6.3M cassowary  1 Jan 12:34  6_MiB +.rw-r--r-- 7 cassowary  1 Jan 12:34  7_bytes +.rw-r--r-- 7.2k cassowary  1 Jan 12:34  7_KiB +.rw-r--r-- 7.3M cassowary  1 Jan 12:34  7_MiB +.rw-r--r-- 8 cassowary  1 Jan 12:34  8_bytes +.rw-r--r-- 8.2k cassowary  1 Jan 12:34  8_KiB +.rw-r--r-- 8.4M cassowary  1 Jan 12:34  8_MiB +.rw-r--r-- 9 cassowary  1 Jan 12:34  9_bytes +.rw-r--r-- 9.2k cassowary  1 Jan 12:34  9_KiB +.rw-r--r-- 9.4M cassowary  1 Jan 12:34  9_MiB +.rw-r--r-- 10 cassowary  1 Jan 12:34  10_bytes +.rw-r--r-- 10k cassowary  1 Jan 12:34  10_KiB +.rw-r--r-- 10M cassowary  1 Jan 12:34  10_MiB +.rw-r--r-- 11 cassowary  1 Jan 12:34  11_bytes +.rw-r--r-- 11k cassowary  1 Jan 12:34  11_KiB +.rw-r--r-- 11M cassowary  1 Jan 12:34  11_MiB +.rw-r--r-- 12 cassowary  1 Jan 12:34  12_bytes +.rw-r--r-- 12k cassowary  1 Jan 12:34  12_KiB +.rw-r--r-- 12M cassowary  1 Jan 12:34  12_MiB +.rw-r--r-- 13 cassowary  1 Jan 12:34  13_bytes +.rw-r--r-- 13k cassowary  1 Jan 12:34  13_KiB +.rw-r--r-- 13M cassowary  1 Jan 12:34  13_MiB diff --git a/xtests/outputs/files_long_icons.ansitxt b/xtests/outputs/files_long_icons.ansitxt index 01c102b..5807ff1 100644 --- a/xtests/outputs/files_long_icons.ansitxt +++ b/xtests/outputs/files_long_icons.ansitxt @@ -1,39 +1,39 @@ -.rw-r--r-- 1 cassowary  1 Jan 12:34  1_bytes -.rw-r--r-- 1.0k cassowary  1 Jan 12:34  1_KiB -.rw-r--r-- 1.0M cassowary  1 Jan 12:34  1_MiB -.rw-r--r-- 2 cassowary  1 Jan 12:34  2_bytes -.rw-r--r-- 2.0k cassowary  1 Jan 12:34  2_KiB -.rw-r--r-- 2.1M cassowary  1 Jan 12:34  2_MiB -.rw-r--r-- 3 cassowary  1 Jan 12:34  3_bytes -.rw-r--r-- 3.1k cassowary  1 Jan 12:34  3_KiB -.rw-r--r-- 3.1M cassowary  1 Jan 12:34  3_MiB -.rw-r--r-- 4 cassowary  1 Jan 12:34  4_bytes -.rw-r--r-- 4.1k cassowary  1 Jan 12:34  4_KiB -.rw-r--r-- 4.2M cassowary  1 Jan 12:34  4_MiB -.rw-r--r-- 5 cassowary  1 Jan 12:34  5_bytes -.rw-r--r-- 5.1k cassowary  1 Jan 12:34  5_KiB -.rw-r--r-- 5.2M cassowary  1 Jan 12:34  5_MiB -.rw-r--r-- 6 cassowary  1 Jan 12:34  6_bytes -.rw-r--r-- 6.1k cassowary  1 Jan 12:34  6_KiB -.rw-r--r-- 6.3M cassowary  1 Jan 12:34  6_MiB -.rw-r--r-- 7 cassowary  1 Jan 12:34  7_bytes -.rw-r--r-- 7.2k cassowary  1 Jan 12:34  7_KiB -.rw-r--r-- 7.3M cassowary  1 Jan 12:34  7_MiB -.rw-r--r-- 8 cassowary  1 Jan 12:34  8_bytes -.rw-r--r-- 8.2k cassowary  1 Jan 12:34  8_KiB -.rw-r--r-- 8.4M cassowary  1 Jan 12:34  8_MiB -.rw-r--r-- 9 cassowary  1 Jan 12:34  9_bytes -.rw-r--r-- 9.2k cassowary  1 Jan 12:34  9_KiB -.rw-r--r-- 9.4M cassowary  1 Jan 12:34  9_MiB -.rw-r--r-- 10 cassowary  1 Jan 12:34  10_bytes -.rw-r--r-- 10k cassowary  1 Jan 12:34  10_KiB -.rw-r--r-- 10M cassowary  1 Jan 12:34  10_MiB -.rw-r--r-- 11 cassowary  1 Jan 12:34  11_bytes -.rw-r--r-- 11k cassowary  1 Jan 12:34  11_KiB -.rw-r--r-- 11M cassowary  1 Jan 12:34  11_MiB -.rw-r--r-- 12 cassowary  1 Jan 12:34  12_bytes -.rw-r--r-- 12k cassowary  1 Jan 12:34  12_KiB -.rw-r--r-- 12M cassowary  1 Jan 12:34  12_MiB -.rw-r--r-- 13 cassowary  1 Jan 12:34  13_bytes -.rw-r--r-- 13k cassowary  1 Jan 12:34  13_KiB -.rw-r--r-- 13M cassowary  1 Jan 12:34  13_MiB +.rw-r--r-- 1 cassowary  1 Jan 12:34  1_bytes +.rw-r--r-- 1.0k cassowary  1 Jan 12:34  1_KiB +.rw-r--r-- 1.0M cassowary  1 Jan 12:34  1_MiB +.rw-r--r-- 2 cassowary  1 Jan 12:34  2_bytes +.rw-r--r-- 2.0k cassowary  1 Jan 12:34  2_KiB +.rw-r--r-- 2.1M cassowary  1 Jan 12:34  2_MiB +.rw-r--r-- 3 cassowary  1 Jan 12:34  3_bytes +.rw-r--r-- 3.1k cassowary  1 Jan 12:34  3_KiB +.rw-r--r-- 3.1M cassowary  1 Jan 12:34  3_MiB +.rw-r--r-- 4 cassowary  1 Jan 12:34  4_bytes +.rw-r--r-- 4.1k cassowary  1 Jan 12:34  4_KiB +.rw-r--r-- 4.2M cassowary  1 Jan 12:34  4_MiB +.rw-r--r-- 5 cassowary  1 Jan 12:34  5_bytes +.rw-r--r-- 5.1k cassowary  1 Jan 12:34  5_KiB +.rw-r--r-- 5.2M cassowary  1 Jan 12:34  5_MiB +.rw-r--r-- 6 cassowary  1 Jan 12:34  6_bytes +.rw-r--r-- 6.1k cassowary  1 Jan 12:34  6_KiB +.rw-r--r-- 6.3M cassowary  1 Jan 12:34  6_MiB +.rw-r--r-- 7 cassowary  1 Jan 12:34  7_bytes +.rw-r--r-- 7.2k cassowary  1 Jan 12:34  7_KiB +.rw-r--r-- 7.3M cassowary  1 Jan 12:34  7_MiB +.rw-r--r-- 8 cassowary  1 Jan 12:34  8_bytes +.rw-r--r-- 8.2k cassowary  1 Jan 12:34  8_KiB +.rw-r--r-- 8.4M cassowary  1 Jan 12:34  8_MiB +.rw-r--r-- 9 cassowary  1 Jan 12:34  9_bytes +.rw-r--r-- 9.2k cassowary  1 Jan 12:34  9_KiB +.rw-r--r-- 9.4M cassowary  1 Jan 12:34  9_MiB +.rw-r--r-- 10 cassowary  1 Jan 12:34  10_bytes +.rw-r--r-- 10k cassowary  1 Jan 12:34  10_KiB +.rw-r--r-- 10M cassowary  1 Jan 12:34  10_MiB +.rw-r--r-- 11 cassowary  1 Jan 12:34  11_bytes +.rw-r--r-- 11k cassowary  1 Jan 12:34  11_KiB +.rw-r--r-- 11M cassowary  1 Jan 12:34  11_MiB +.rw-r--r-- 12 cassowary  1 Jan 12:34  12_bytes +.rw-r--r-- 12k cassowary  1 Jan 12:34  12_KiB +.rw-r--r-- 12M cassowary  1 Jan 12:34  12_MiB +.rw-r--r-- 13 cassowary  1 Jan 12:34  13_bytes +.rw-r--r-- 13k cassowary  1 Jan 12:34  13_KiB +.rw-r--r-- 13M cassowary  1 Jan 12:34  13_MiB diff --git a/xtests/outputs/files_long_tree_icons.ansitxt b/xtests/outputs/files_long_tree_icons.ansitxt index 0c8b18d..ab16fda 100644 --- a/xtests/outputs/files_long_tree_icons.ansitxt +++ b/xtests/outputs/files_long_tree_icons.ansitxt @@ -1,40 +1,40 @@ -drwxrwxr-x - vagrant 18 Oct 00:18  /testcases/files -.rw-r--r-- 1 cassowary  1 Jan 12:34 ├──  1_bytes -.rw-r--r-- 1.0k cassowary  1 Jan 12:34 ├──  1_KiB -.rw-r--r-- 1.0M cassowary  1 Jan 12:34 ├──  1_MiB -.rw-r--r-- 2 cassowary  1 Jan 12:34 ├──  2_bytes -.rw-r--r-- 2.0k cassowary  1 Jan 12:34 ├──  2_KiB -.rw-r--r-- 2.1M cassowary  1 Jan 12:34 ├──  2_MiB -.rw-r--r-- 3 cassowary  1 Jan 12:34 ├──  3_bytes -.rw-r--r-- 3.1k cassowary  1 Jan 12:34 ├──  3_KiB -.rw-r--r-- 3.1M cassowary  1 Jan 12:34 ├──  3_MiB -.rw-r--r-- 4 cassowary  1 Jan 12:34 ├──  4_bytes -.rw-r--r-- 4.1k cassowary  1 Jan 12:34 ├──  4_KiB -.rw-r--r-- 4.2M cassowary  1 Jan 12:34 ├──  4_MiB -.rw-r--r-- 5 cassowary  1 Jan 12:34 ├──  5_bytes -.rw-r--r-- 5.1k cassowary  1 Jan 12:34 ├──  5_KiB -.rw-r--r-- 5.2M cassowary  1 Jan 12:34 ├──  5_MiB -.rw-r--r-- 6 cassowary  1 Jan 12:34 ├──  6_bytes -.rw-r--r-- 6.1k cassowary  1 Jan 12:34 ├──  6_KiB -.rw-r--r-- 6.3M cassowary  1 Jan 12:34 ├──  6_MiB -.rw-r--r-- 7 cassowary  1 Jan 12:34 ├──  7_bytes -.rw-r--r-- 7.2k cassowary  1 Jan 12:34 ├──  7_KiB -.rw-r--r-- 7.3M cassowary  1 Jan 12:34 ├──  7_MiB -.rw-r--r-- 8 cassowary  1 Jan 12:34 ├──  8_bytes -.rw-r--r-- 8.2k cassowary  1 Jan 12:34 ├──  8_KiB -.rw-r--r-- 8.4M cassowary  1 Jan 12:34 ├──  8_MiB -.rw-r--r-- 9 cassowary  1 Jan 12:34 ├──  9_bytes -.rw-r--r-- 9.2k cassowary  1 Jan 12:34 ├──  9_KiB -.rw-r--r-- 9.4M cassowary  1 Jan 12:34 ├──  9_MiB -.rw-r--r-- 10 cassowary  1 Jan 12:34 ├──  10_bytes -.rw-r--r-- 10k cassowary  1 Jan 12:34 ├──  10_KiB -.rw-r--r-- 10M cassowary  1 Jan 12:34 ├──  10_MiB -.rw-r--r-- 11 cassowary  1 Jan 12:34 ├──  11_bytes -.rw-r--r-- 11k cassowary  1 Jan 12:34 ├──  11_KiB -.rw-r--r-- 11M cassowary  1 Jan 12:34 ├──  11_MiB -.rw-r--r-- 12 cassowary  1 Jan 12:34 ├──  12_bytes -.rw-r--r-- 12k cassowary  1 Jan 12:34 ├──  12_KiB -.rw-r--r-- 12M cassowary  1 Jan 12:34 ├──  12_MiB -.rw-r--r-- 13 cassowary  1 Jan 12:34 ├──  13_bytes -.rw-r--r-- 13k cassowary  1 Jan 12:34 ├──  13_KiB -.rw-r--r-- 13M cassowary  1 Jan 12:34 └──  13_MiB +drwxrwxr-x - vagrant 18 Oct 00:18  /testcases/files +.rw-r--r-- 1 cassowary  1 Jan 12:34 ├──  1_bytes +.rw-r--r-- 1.0k cassowary  1 Jan 12:34 ├──  1_KiB +.rw-r--r-- 1.0M cassowary  1 Jan 12:34 ├──  1_MiB +.rw-r--r-- 2 cassowary  1 Jan 12:34 ├──  2_bytes +.rw-r--r-- 2.0k cassowary  1 Jan 12:34 ├──  2_KiB +.rw-r--r-- 2.1M cassowary  1 Jan 12:34 ├──  2_MiB +.rw-r--r-- 3 cassowary  1 Jan 12:34 ├──  3_bytes +.rw-r--r-- 3.1k cassowary  1 Jan 12:34 ├──  3_KiB +.rw-r--r-- 3.1M cassowary  1 Jan 12:34 ├──  3_MiB +.rw-r--r-- 4 cassowary  1 Jan 12:34 ├──  4_bytes +.rw-r--r-- 4.1k cassowary  1 Jan 12:34 ├──  4_KiB +.rw-r--r-- 4.2M cassowary  1 Jan 12:34 ├──  4_MiB +.rw-r--r-- 5 cassowary  1 Jan 12:34 ├──  5_bytes +.rw-r--r-- 5.1k cassowary  1 Jan 12:34 ├──  5_KiB +.rw-r--r-- 5.2M cassowary  1 Jan 12:34 ├──  5_MiB +.rw-r--r-- 6 cassowary  1 Jan 12:34 ├──  6_bytes +.rw-r--r-- 6.1k cassowary  1 Jan 12:34 ├──  6_KiB +.rw-r--r-- 6.3M cassowary  1 Jan 12:34 ├──  6_MiB +.rw-r--r-- 7 cassowary  1 Jan 12:34 ├──  7_bytes +.rw-r--r-- 7.2k cassowary  1 Jan 12:34 ├──  7_KiB +.rw-r--r-- 7.3M cassowary  1 Jan 12:34 ├──  7_MiB +.rw-r--r-- 8 cassowary  1 Jan 12:34 ├──  8_bytes +.rw-r--r-- 8.2k cassowary  1 Jan 12:34 ├──  8_KiB +.rw-r--r-- 8.4M cassowary  1 Jan 12:34 ├──  8_MiB +.rw-r--r-- 9 cassowary  1 Jan 12:34 ├──  9_bytes +.rw-r--r-- 9.2k cassowary  1 Jan 12:34 ├──  9_KiB +.rw-r--r-- 9.4M cassowary  1 Jan 12:34 ├──  9_MiB +.rw-r--r-- 10 cassowary  1 Jan 12:34 ├──  10_bytes +.rw-r--r-- 10k cassowary  1 Jan 12:34 ├──  10_KiB +.rw-r--r-- 10M cassowary  1 Jan 12:34 ├──  10_MiB +.rw-r--r-- 11 cassowary  1 Jan 12:34 ├──  11_bytes +.rw-r--r-- 11k cassowary  1 Jan 12:34 ├──  11_KiB +.rw-r--r-- 11M cassowary  1 Jan 12:34 ├──  11_MiB +.rw-r--r-- 12 cassowary  1 Jan 12:34 ├──  12_bytes +.rw-r--r-- 12k cassowary  1 Jan 12:34 ├──  12_KiB +.rw-r--r-- 12M cassowary  1 Jan 12:34 ├──  12_MiB +.rw-r--r-- 13 cassowary  1 Jan 12:34 ├──  13_bytes +.rw-r--r-- 13k cassowary  1 Jan 12:34 ├──  13_KiB +.rw-r--r-- 13M cassowary  1 Jan 12:34 └──  13_MiB diff --git a/xtests/outputs/files_oneline_icons.ansitxt b/xtests/outputs/files_oneline_icons.ansitxt index 6601661..ac279a0 100644 --- a/xtests/outputs/files_oneline_icons.ansitxt +++ b/xtests/outputs/files_oneline_icons.ansitxt @@ -1,39 +1,39 @@ - 1_bytes - 1_KiB - 1_MiB - 2_bytes - 2_KiB - 2_MiB - 3_bytes - 3_KiB - 3_MiB - 4_bytes - 4_KiB - 4_MiB - 5_bytes - 5_KiB - 5_MiB - 6_bytes - 6_KiB - 6_MiB - 7_bytes - 7_KiB - 7_MiB - 8_bytes - 8_KiB - 8_MiB - 9_bytes - 9_KiB - 9_MiB - 10_bytes - 10_KiB - 10_MiB - 11_bytes - 11_KiB - 11_MiB - 12_bytes - 12_KiB - 12_MiB - 13_bytes - 13_KiB - 13_MiB + 1_bytes + 1_KiB + 1_MiB + 2_bytes + 2_KiB + 2_MiB + 3_bytes + 3_KiB + 3_MiB + 4_bytes + 4_KiB + 4_MiB + 5_bytes + 5_KiB + 5_MiB + 6_bytes + 6_KiB + 6_MiB + 7_bytes + 7_KiB + 7_MiB + 8_bytes + 8_KiB + 8_MiB + 9_bytes + 9_KiB + 9_MiB + 10_bytes + 10_KiB + 10_MiB + 11_bytes + 11_KiB + 11_MiB + 12_bytes + 12_KiB + 12_MiB + 13_bytes + 13_KiB + 13_MiB diff --git a/xtests/outputs/files_tree_icons.ansitxt b/xtests/outputs/files_tree_icons.ansitxt index ecd5d32..2d05bca 100644 --- a/xtests/outputs/files_tree_icons.ansitxt +++ b/xtests/outputs/files_tree_icons.ansitxt @@ -1,40 +1,40 @@ - /testcases/files -├──  1_bytes -├──  1_KiB -├──  1_MiB -├──  2_bytes -├──  2_KiB -├──  2_MiB -├──  3_bytes -├──  3_KiB -├──  3_MiB -├──  4_bytes -├──  4_KiB -├──  4_MiB -├──  5_bytes -├──  5_KiB -├──  5_MiB -├──  6_bytes -├──  6_KiB -├──  6_MiB -├──  7_bytes -├──  7_KiB -├──  7_MiB -├──  8_bytes -├──  8_KiB -├──  8_MiB -├──  9_bytes -├──  9_KiB -├──  9_MiB -├──  10_bytes -├──  10_KiB -├──  10_MiB -├──  11_bytes -├──  11_KiB -├──  11_MiB -├──  12_bytes -├──  12_KiB -├──  12_MiB -├──  13_bytes -├──  13_KiB -└──  13_MiB + /testcases/files +├──  1_bytes +├──  1_KiB +├──  1_MiB +├──  2_bytes +├──  2_KiB +├──  2_MiB +├──  3_bytes +├──  3_KiB +├──  3_MiB +├──  4_bytes +├──  4_KiB +├──  4_MiB +├──  5_bytes +├──  5_KiB +├──  5_MiB +├──  6_bytes +├──  6_KiB +├──  6_MiB +├──  7_bytes +├──  7_KiB +├──  7_MiB +├──  8_bytes +├──  8_KiB +├──  8_MiB +├──  9_bytes +├──  9_KiB +├──  9_MiB +├──  10_bytes +├──  10_KiB +├──  10_MiB +├──  11_bytes +├──  11_KiB +├──  11_MiB +├──  12_bytes +├──  12_KiB +├──  12_MiB +├──  13_bytes +├──  13_KiB +└──  13_MiB diff --git a/xtests/outputs/links_oneline_icons.ansitxt b/xtests/outputs/links_oneline_icons.ansitxt index 914aa12..7457089 100644 --- a/xtests/outputs/links_oneline_icons.ansitxt +++ b/xtests/outputs/links_oneline_icons.ansitxt @@ -1,10 +1,10 @@ - broken -> nowhere - current_dir -> . - forbidden -> /proc/1/root - itself -> itself - parent_dir -> .. - root -> / - some_file - some_file_absolute -> /testcases/links/some_file - some_file_relative -> some_file - usr -> /usr + broken -> nowhere + current_dir -> . + forbidden -> /proc/1/root + itself -> itself + parent_dir -> .. + root -> / + some_file + some_file_absolute -> /testcases/links/some_file + some_file_relative -> some_file + usr -> /usr diff --git a/xtests/outputs/links_oneline_icons_width0.ansitxt b/xtests/outputs/links_oneline_icons_width0.ansitxt new file mode 100644 index 0000000..867c310 --- /dev/null +++ b/xtests/outputs/links_oneline_icons_width0.ansitxt @@ -0,0 +1,10 @@ +broken -> nowhere +current_dir -> . +forbidden -> /proc/1/root +itself -> itself +parent_dir -> .. +root -> / +some_file +some_file_absolute -> /testcases/links/some_file +some_file_relative -> some_file +usr -> /usr diff --git a/xtests/outputs/links_oneline_icons_width2.ansitxt b/xtests/outputs/links_oneline_icons_width2.ansitxt new file mode 100644 index 0000000..914aa12 --- /dev/null +++ b/xtests/outputs/links_oneline_icons_width2.ansitxt @@ -0,0 +1,10 @@ + broken -> nowhere + current_dir -> . + forbidden -> /proc/1/root + itself -> itself + parent_dir -> .. + root -> / + some_file + some_file_absolute -> /testcases/links/some_file + some_file_relative -> some_file + usr -> /usr diff --git a/xtests/outputs/links_oneline_icons_width3.ansitxt b/xtests/outputs/links_oneline_icons_width3.ansitxt new file mode 100644 index 0000000..417a6c3 --- /dev/null +++ b/xtests/outputs/links_oneline_icons_width3.ansitxt @@ -0,0 +1,10 @@ + broken -> nowhere + current_dir -> . + forbidden -> /proc/1/root + itself -> itself + parent_dir -> .. + root -> / + some_file + some_file_absolute -> /testcases/links/some_file + some_file_relative -> some_file + usr -> /usr diff --git a/xtests/outputs/permissions_oneline_icons.ansitxt b/xtests/outputs/permissions_oneline_icons.ansitxt index 34cded0..e982768 100644 --- a/xtests/outputs/permissions_oneline_icons.ansitxt +++ b/xtests/outputs/permissions_oneline_icons.ansitxt @@ -1,22 +1,22 @@ - 000 - 001 - 002 - 004 - 010 - 020 - 040 - 100 - 200 - 400 - 644 - 755 - 777 - 1000 - 1001 - 2000 - 2010 - 4000 - 4100 - 7666 - 7777 - forbidden-directory + 000 + 001 + 002 + 004 + 010 + 020 + 040 + 100 + 200 + 400 + 644 + 755 + 777 + 1000 + 1001 + 2000 + 2010 + 4000 + 4100 + 7666 + 7777 + forbidden-directory