lusingander / stu

TUI explorer application for Amazon S3 (AWS S3) 🪣
https://lusingander.github.io/stu/
MIT License
239 stars 8 forks source link

Preview file displays strange chars #22

Closed williamdes closed 1 month ago

williamdes commented 1 month ago

image

Received: from dc18.wdes.intranet (unknown [10.10.18.120])
    (using TLSv1.3 with cipher TLS13_AES_256_GCM_SHA384)
    by mx2.mails.wdes.eu (Stalwart SMTP) with ESMTPS id 29EA16FB9A12202;
    Mon, 29 Jul 2024 22:01:56 +0000
Authentication-Results: mx2.mails.wdes.eu;
    spf=none (mx2.mails.wdes.eu: no SPF records found for postmaster@dc18.wdes.intranet) smtp.helo=dc18.wdes.intranet;
    spf=none (mx2.mails.wdes.eu: no SPF records found for pve@proxmox.dc18.wdes.intranet) smtp.mailfrom=pve@proxmox.dc18.wdes.intranet;
    iprev=permerror (dns record not found) policy.iprev=10.10.18.120;
    dmarc=none header.from=proxmox.dc18.wdes.intranet policy.dmarc=none
Received-SPF: none (mx2.mails.wdes.eu: no SPF records found for pve@proxmox.dc18.wdes.intranet)
    receiver=mx2.mails.wdes.eu; client-ip=10.10.18.120; envelope-from="pve@proxmox.dc18.wdes.intranet"; helo=dc18.wdes.intranet;
X-Spam-Status: Yes, score=5.518642402045409
X-Spam-Result: MID_RHS_MATCH_FROMTLD (1),
    TO_MATCH_ENVRCPT_ALL (0),
    RBL_SENDERSCORE (2),
    FROM_EQ_ENVFROM (0),
    TO_DN_NONE (0),
    TAGGED_RCPT (0),
    SPF_NA (0),
    HELO_NORES_A_OR_MX (0.3),
    RCVD_TLS_LAST (0),
    FROM_NO_DN (0),
    RCVD_COUNT_ONE (0),
    URIBL_BLOCKED (0),
    ARC_NA (0),
    DKIM_NA (0),
    RCPT_COUNT_ONE (0),
    RDNS_NONE (1),
    AUTH_NA (1),
    DMARC_NA (0),
    FROMHOST_NORES_A_OR_MX (1.5)
Return-Path: <pve@proxmox.dc18.wdes.intranet>
Received: by dc18.wdes.intranet (Postfix, from userid 0)
    id 83C7227A3C; Tue, 30 Jul 2024 00:00:41 +0200 (CEST)
From: pve@proxmox.dc18.wdes.intranet
To: tech+dc18@wdes.eu
Subject: Cron <root@pve-dc18> pve-autosnap all 2 --exclude=10001,10002 --tag=DAILY
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Cron-Env: <MAILTO=tech+proxmox-cron@wdes.eu>
X-Cron-Env: <MAILFROM=tech+dc18-proxmox@wdes.eu>

Maybe tabs create such display bugs ? Terminal: Guake and XFCE terminal.

lusingander commented 1 month ago

At least when I uploaded the attached text, I didn't have any problems.

Similarly, if you re-upload it (by copying the code block), does the same problem occur? If it does, it could be a problem with your terminal environment, etc. If not, it's likely a problem with the original text file.

Maybe tabs create such display bugs ?

Tabs are replaced with spaces (because the library doesn't handle them well), so it seems unlikely that this is the cause.

lusingander commented 1 month ago

It seems that a similar problem may occur when opening binary files etc. It may be that some binary sequence, including tabs, is causing the problem.

williamdes commented 1 month ago

It seems that a similar problem may occur when opening binary files etc. It may be that some binary sequence, including tabs, is causing the problem.

Well, it is a pure text file as attached but the mime is declared as binary

williamdes commented 1 month ago

The actual content type of my objects is application/octet-stream

lusingander commented 1 month ago

📝

v0.5.0: Seems to be displayed correctly v0.5.1: Not correct

During these releases, the ratatui version was updated to 0.27.0. https://github.com/lusingander/stu/compare/v0.5.0...v0.5.1

lusingander commented 1 month ago

31 fixed the problem, at least for me. If you still have any problems, please let me know.

lusingander commented 1 month ago

https://github.com/lusingander/stu/releases/tag/v0.6.3

williamdes commented 1 month ago

https://github.com/lusingander/stu/releases/tag/v0.6.3

The display works fine now, thank you !

lusingander commented 1 month ago

That's good to hear!