Follow-up Comment #1, bug #67720 (group screen): I encountered the same regression described in this report when using GNU Screen 5.0.2 on Gentoo Linux.
After investigating `FindAKA()` in `ansi.c`, I found two places where Screen's
internal `uint32_t` terminal character arrays were incorrectly interpreted as
byte strings:
1. The prompt comparison uses `strncmp()` on a cast `uint32_t *`.
2. The command-name extraction passes a cast `uint32_t *` directly to
`ChangeAKA()`.
The attached patch addresses both problems by comparing prompt characters
individually and converting the extracted command name into a bounded,
null-terminated character buffer.
*Testing*
- Patch applies cleanly to the GNU Screen 5.0.2 release source.
- Successfully compiled and installed using Gentoo Portage.
- Confirmed that automatic window naming works again using `shelltitle "$
|bash"` and Bash's `PROMPT_COMMAND` title escape sequence.
*Limitation*
The current patch targets ASCII prompt markers and command names. Non-ASCII
command-name characters are replaced with `?`, and full character-encoding
support is not implemented.
I'd appreciate feedback on whether this approach is acceptable or whether a
more general encoding-aware fix would be preferred.
Attachment: `fix-autoaka-v3.patch`
(file #59193)
_______________________________________________________
Additional Item Attachment:
Name: fix-autoaka-v3.patch Size: 1.4KiB
<https://file.savannah.gnu.org/file/fix-autoaka-v3.patch?file_id=59193>
AGPL NOTICE
These attachments are served by Savane. You can download the corresponding
source code of Savane at
https://savannah.gnu.org/source/savane-99b9bb5c89ddd7e7187ecbf606b99ab99423d38f.tar.gz
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?67720>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
signature.asc
Description: PGP signature
