URL:
  <https://savannah.gnu.org/bugs/?68643>

                 Summary: UTF-8 corruption/alignment issues in hardstatus
caption rendering
                   Group: GNU Screen
               Submitter: pdey
               Submitted: Tue 25 Aug 2026 08:03:47 AM UTC
                Category: encoding
                Severity: 3 - Normal
                Priority: 5 - Normal
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Unlocked
                 Release: 5.0.2
           Fixed Release: None
         Planned Release: None
           Work Required: None


    _______________________________________________________

Follow-up Comments:


-------------------------------------------------------
Date: Tue 25 Aug 2026 08:03:47 AM UTC By: Peter Dey <pdey>
Fixing bug #18505 exposed additional UTF-8 issues in hardstatus handling.

With non-ASCII caption text, hardstatus width accounting can be wrong
(byte/cell mismatch), causing under/over-padding and occasional overflow
artifacts.

Also, the OSC title forwarding path can re-encode already-UTF-8 data, causing
corruption.

In some cases after hardstatus redraw, cursor restore uses stale relative
state and prompt/cursor lands on the wrong line until a redraw.

Minimal hardstatus to reproduce:
  hardstatus alwayslastline "%=%t | %c "

Tests:
  printf '\e]0;%s\e\' "abc|ó|ą|⭍|💩"
  printf '\e]0;%s\e\' "Fußgängerübergänge"

Three patches attached to resolve this.

I suspect there is a deeper underlying issue around cell-width accounting, and
these three patches address the symptoms rather than the root cause.






    _______________________________________________________
File Attachments:

Name: fix-utf8-caption-hardstatus-padding.patch Size: 3.0KiB

<https://file.savannah.gnu.org/file/fix-utf8-caption-hardstatus-padding.patch?file_id=58909>

Name: force-absolute-cursor-restore-after-hardstatus-redraw.patch Size: 1.5KiB

<https://file.savannah.gnu.org/file/force-absolute-cursor-restore-after-hardstatus-redraw.patch?file_id=58910>

Name: avoid-utf8-double-encoding-in-xterm-osc-forwarding.patch Size: 1.1KiB

<https://file.savannah.gnu.org/file/avoid-utf8-double-encoding-in-xterm-osc-forwarding.patch?file_id=58911>



    AGPL NOTICE

These attachments are served by Savane. You can download the corresponding
source code of Savane at
https://savannah.gnu.org/source/savane-4181554c69edff56f2b7ab173a9edf218606c6a7.tar.gz

    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?68643>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/

Attachment: signature.asc
Description: PGP signature

Reply via email to