Repository: eza-community/eza (language: rust)

Issue:
`--hyperlinks` seem to break `-l --grid`
Demonstration
![2023-08-13_06-30](https://github.com/eza-community/eza/assets/89321978/3734b105-a773-43ef-9366-b348390f95b2)

In the eza root dir
![2023-08-13_06-30_1](https://github.com/eza-community/eza/assets/89321978/97290752-21c6-4361-9d44-785278ce57dc)

But not if we remove `--hyperlink`
![2023-08-13_06-31](https://github.com/eza-community/eza/assets/89321978/1aae72a7-2011-44af-b75f-3dea4d9d1cd7)



Discussion / hints:
I'm not gonna have time for this right now so this issue is up for grabs

Fix patch:
diff --git a/src/output/grid_details.rs b/src/output/grid_details.rs
index 70708a9a5..e0d0fb91c 100644
--- a/src/output/grid_details.rs
+++ b/src/output/grid_details.rs
@@ -8,9 +8,10 @@ use term_grid as grid;
 use crate::fs::{Dir, File};
 use crate::fs::feature::git::GitCache;
 use crate::fs::filter::FileFilter;
-use crate::output::cell::TextCell;
+use crate::output::cell::{TextCell, DisplayWidth};
 use crate::output::details::{Options as DetailsOptions, Row as DetailsRow, Render as DetailsRender};
 use crate::output::file_name::Options as FileStyle;
+use crate::output::file_name::{ShowIcons, EmbedHyperlinks};
 use crate::output::grid::Options as GridOptions;
 use crate::output::table::{Table, Row as TableRow, Options as TableOptions};
 use crate::output::tree::{TreeParams, TreeDepth};
@@ -153,8 +154,23 @@ impl<'a> Render<'a> {
                        .collect::<Vec<_>>();
 
         let file_names = self.files.iter()
-                             .map(|file| self.file_style.for_file(file, self.theme).paint().promote())
-                             .collect::<Vec<_>>();
+            .map(|file| {
+                let filename = self.file_style.for_file(file, self.theme);
+                let contents = filename.paint();
+                let width = match (filename.options.embed_hyperlinks, filename.options.show_icons) {
+                    (EmbedHyperlinks::On, ShowIcons::On(spacing)) => filename.bare_width() + 1 + (spacing as usize),
+                    (EmbedHyperlinks::On, ShowIcons::Off) => filename.bare_width(),
+                    (EmbedHyperlinks::Off, _) => *contents.width(),
+                };
+
+                TextCell {
+                    contents,
+                    // with hyperlink escape sequences,
+                    // the actual *contents.width() is larger than actually needed, so we take only the filename
+                    width: DisplayWidth::from(width),
+                }
+            })
+            .collect::<Vec<_>>();
 
         let mut last_working_grid = self.make_grid(1, options, &file_names, rows.clone(), &drender);
 


Test patch: