From 93f4c499d47e74b88dd1fa0993444ae5fbcb2921 Mon Sep 17 00:00:00 2001 From: Master-Guy <566429+Master-Guy@users.noreply.github.com> Date: Thu, 17 Mar 2022 16:56:32 +0100 Subject: [PATCH] Quick fix to prevent division by 0 --- src/Terminal/commands/ls.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Terminal/commands/ls.tsx b/src/Terminal/commands/ls.tsx index 6ef2cc48c..ff001a064 100644 --- a/src/Terminal/commands/ls.tsx +++ b/src/Terminal/commands/ls.tsx @@ -167,7 +167,7 @@ export function ls( function postSegments(segments: string[], style?: any, linked?: boolean): void { const maxLength = Math.max(...segments.map((s) => s.length)) + 1; - const filesPerRow = Math.floor(80 / maxLength); + const filesPerRow = Math.ceil(80 / maxLength); for (let i = 0; i < segments.length; i++) { let row = ""; for (let col = 0; col < filesPerRow; col++) {