CRLF and LF characters inside a message% add unwanted extra lines in Windows
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 42/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 领域
- desktop
调研方向
从使用 message% 的最小 racket/gui 示例开始,并在 Windows 和 Ubuntu 上复现 CRLF、LF 和 CR 的情况。比较各平台上渲染出的行尾;当受支持的换行形式不再添加不需要的空行,或该行为已被明确记录为符合预期时,即视为完成。
由索引模型根据 Issue 内容生成。
描述
When creating a multi-line message% in a racket/gui app and running the app on an Ubuntu system, things display correctly no matter which line separator I use, i.e. it doesn't matter whether I use \n (the usual in Linux), \r\n (Windows) or even \r (which AFAIK is uncommon).
This is the app running in Racket v8.5 [cs] on Ubuntu 22.04 LTS:

However, when I run the same code in Windows, both the "CRLF" and the "LF only" versions add unwanted blank lines at the end, apparently one per line. Only the weird "CR only" version does what I want.
Same app, Racket v8.5 [cs], Windows 10:

The code I'm running:
#lang racket/gui
(define window-1 (new frame% [label "CRLF"] [width 256]))
(new message% [parent window-1] [label "Line 1\r\nLine 2\r\nLine 3"])
(send window-1 show #t)
(define window-2 (new frame% [label "CR only"] [width 256]))
(new message% [parent window-2] [label "Line 1\rLine 2\rLine 3"])
(send window-2 show #t)
(define window-3 (new frame% [label "LF only"] [width 256]))
(new message% [parent window-3] [label "Line 1\nLine 2\nLine 3"])
(send window-3 show #t)
I wouldn't have been surprised if Windows was only happy with the CRLF version, but just CR by itself seems like something's off. Is this expected behavior or an actual bug?
- 主要语言
- Racket
- 星标
- 68
- 派生
- 83
- 平均合并
- 4 天 4 小时
- 30 天内合并 PR
- 3
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
racket/gui 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 65/100
-
难度 4/5 3-5 天 新手友好度 35/100
-
难度 4/5 3-5 天 新手友好度 45/100
-
难度 4/5 3-5 天 新手友好度 45/100
-
难度 4/5 3-5 天 新手友好度 35/100
相似的 Issue
-
bug priority: low
难度 2/5 1-3 小时 新手友好度 78/100
storytold/photocraft#12183 · 1 条评论 ·
维护者通常 2 天内回复
-
Tiling managers are not destroyed in disable(), so window-created handlers keep running (Gio.Settings constructed without schema)可能已有人在做 @gnacho 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 72/100
domferr/tilingshell#641 ·
维护者通常 3 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 69/100
ni/nipanel-python#221 ·
-
bug
难度 2/5 1-3 小时 新手友好度 68/100
transit-audio/transit#369 ·
-
bug priority: medium
难度 2/5 1-3 小时 新手友好度 68/100
storytold/vectorcraft#6143 · 1 条评论 ·
维护者通常 1 天内回复