ouch icon indicating copy to clipboard operation
ouch copied to clipboard

`ouch list` output duplicates slashes of '.zip' archive when STDOUT is piped

Open marcospb19 opened this issue 8 months ago • 4 comments

Version

0.6.0

Description

When I run

$ ouch l ouch-aarch64-pc-windows-msvc.zip | head -n 5
Archive: /home/marcospb19/Downloads/ouch-releases/ouch-aarch64-pc-windows-msvc.zip
ouch-aarch64-pc-windows-msvc//
ouch-aarch64-pc-windows-msvc/man//
ouch-aarch64-pc-windows-msvc/man/ouch-decompress.1
ouch-aarch64-pc-windows-msvc/man/ouch-compress.1

I see duplicated slashes when it's a directory.

marcospb19 avatar Apr 20 '25 18:04 marcospb19

This archive was created with zip -r output input.

When I recreate it with Ouch itself, it doesn't do that.

Could be that CLI zip adds a / at the path, but we are also adding a / when outputting.

marcospb19 avatar Apr 20 '25 19:04 marcospb19

This issue seems unable to be reproduced on linux os. And I am sorry I don't have windows os lol.

Image

tommady avatar May 12 '25 08:05 tommady

Hey @tommady that'd only happen if the output is piped so you'd need to change ouch l a.zip to ouch l a.zip | head -n 5 :) .

marcospb19 avatar May 17 '25 16:05 marcospb19

This issue still exists for me. Tested on a GitHub tarball with both fish and bash, ouch 0.6.1 from nixpkgs, x86_64-linux on NixOS. The issue was never Windows specific from what I can tell either: the zip file @marcospb19 used to test it happened to be an ouch archive for Windows, but if you look at the Archive: line, it's a UNIX path.

output of `ouch ls` in a terminal output of `ouch ls` piped into `cat` in a terminal. the directories all have 2 trailing slashes

EDIT: I just realized there hasn't been a new release in a while so the fixes wouldn't be there yet. compiling from source made it work as expected.

mochienya avatar Nov 29 '25 12:11 mochienya