Tk Source Code

View Ticket
Login
2026-10-24
19:10 • Closed ticket [d5d7f548]: Tk option readfile fails to properly handle \tab in resource files plus 7 other changes artifact: 8efe6ae9 user: nemethi
2026-09-28
12:10
Fix [d5d7f548bd]: option readfile handles backslash-space and backslash-tab as in the X11 resource file syntax check-in: 1e68ab40 user: jan.nijtmans tags: core-9-1-0-rc
11:46
Fix [d5d7f548bd]: option readfile handles backslash-space and backslash-tab as in the X11 resource file syntax check-in: 1b3c3c45 user: jan.nijtmans tags: trunk, main
08:07 • Ticket [d5d7f548] Tk option readfile fails to properly handle \tab in resource files status still Open with 4 other changes artifact: 86dfa2cc user: oehhar
2026-09-25
13:26 • Ticket [d5d7f548]: 4 changes artifact: 319f7d4e user: jan.nijtmans
09:03 • Ticket [766ef52f] option readfile loses list structure status still Open with 3 other changes artifact: b2def940 user: serhiy.storchaka
09:03 • Ticket [d5d7f548] Tk option readfile fails to properly handle \tab in resource files status still Open with 3 other changes artifact: db53a8f4 user: serhiy.storchaka
09:00
Fix [d5d7f548bd]: option readfile handles backslash-space and backslash-tab as in the X11 resource file syntax.

Replace "\ " and "\<tab>" anywhere in the value again, as Xlib does, instead of only one at the start (the special case added for [766ef52f31]). Values which contain backslashes, like Tcl lists, must be escaped when written to the file; this is now documented. Octal escapes accept only octal digits. closed check-in: 7b80bfa5 user: serhiy.storchaka tags: option-readfile-x11-escapes

2019-05-02
02:01 • New ticket [d5d7f548] Tk option readfile fails to properly handle \tab in resource files. artifact: 70ac2931 user: bigfaceworm

Ticket UUID: d5d7f548bdfd38675c268cde3f590ba8103e0f60
Title: Tk [option readfile] fails to properly handle \tab in resource files
Type: Bug Version: 8.6.9
Submitter: bigfaceworm Created on: 2019-05-02 02:01:32
Subsystem: 57. [option] Assigned To: jan.nijtmans
Priority: 5 Medium Severity: Important
Status: Closed Last Modified: 2026-10-24 19:10:51
Resolution: Fixed Closed By: nemethi
    Closed on: 2026-10-24 19:10:51
Description:
Create an option file containing:

*example: \tab

(where the tab is the literal tab character)

Then read that into Tk and examine the result.

According to the spec: https://www.x.org/archive/X11R6.8.1/doc/X.7.html
That should result in just a tab character, but instead, it is currently resulting in \tab (the \ remains).

This behavior was fixed in 8.5 and in 8.6 as a part of: https://core.tcl-lang.org/tk/tktview?name=0aa5e852dc

But, then broken in a fix detailed here: https://core.tcl.tk/tk/info/766ef52f317f3a4a

The original test for this functionality was (incorrectly) updated to have the literal \ remain in front of the tab character.  Test : option-15.7
User Comments: nemethi (claiming to be Csaba Nemethi) added on 2026-10-24 19:10:51:

Merged by Jan into main (only) by commit [1b3c3c45]. No backport to core-9-0-branch or core-8-6-branch is planned. Closing the ticket.


oehhar added on 2026-09-28 08:07:40:

+1 in 9.1. I would urge the merge to not miss 9.1.0...

Thanks, Harald


jan.nijtmans added on 2026-09-25 13:26:00:
Thanks!

We should discuss this in the next bi-weekly telco:
Date: 28th of September 2026
Time: 12:00 UTC
Duration: 1 hour
At: https://meet.jit.si/TclMonthlyMeetup

(Serhiy, it would be nice if you cold join)

My view: We should include this in 9.1, but not backport to 9.0 and 8.6. I'm afraid there's code out there (however incorrect) that would break because of such a change.

serhiy.storchaka added on 2026-09-25 09:03:38:

Proposed fix in branch option-readfile-x11-escapes ([7b80bfa546]): \<space> and \<tab> are replaced anywhere in the value again, as in the X11 resource file syntax and in Xlib, not only one of them at the start. Test option-15.7 has its original expected result again, and option-15.12 is new.