Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

CRLF and LF characters inside a message% add unwanted extra lines in Windows

Đang mở
#272 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
42/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Lĩnh vực
desktop

Hướng nghiên cứu

Bắt đầu với ví dụ racket/gui tối thiểu sử dụng message% và tái hiện các trường hợp CRLF, LF và CR trên Windows và Ubuntu. So sánh các ký tự kết thúc dòng được hiển thị giữa các nền tảng; được xem là hoàn tất khi các dạng dòng mới được hỗ trợ không còn thêm các dòng trống không mong muốn hoặc hành vi được ghi chép rõ ràng là đúng như dự kiến.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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:
crlf_linux

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:
crlf_windows

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?

Ngôn ngữ chính
Racket
Star
68
Fork
83
Merge trung bình
9 ngày 8 giờ
Pull request đã merge (30 ngày)
4

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của racket/gui

Tất cả issue của racket/gui

Issue tương tự

Thêm issue về Desktop Dev

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.