Multi-line text allows parts of Line 2 to bleed into Line 4 (if line 4 length is shorter than line 2 length)

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

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

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
45/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
csharp, powershell
Lĩnh vực
cli

Hướng nghiên cứu

Reproduce the visual bleed-through with the provided multi-line function, Windows Terminal, and Oh-my-posh with TransientPrompt enabled. Trace PSReadLine's multi-line display and redraw behavior, then verify that shorter later lines no longer retain text from earlier lines while execution remains unchanged.

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

Mô tả

Needs-Triage :mag:
Prerequisites
  • Write a descriptive title.
  • Make sure you are able to repro it on the latest released version
  • Search the existing issues, especially the pinned issues.
Exception report
No Exception, just a visual bug / Bleed-through of text

Previous analysis with Jan on Oh-my-posh: https://github.com/JanDeDobbeleer/oh-my-posh/issues/2911
Screenshot

image

Environment data
PS Version: 5.1.22621.436
PS HostName: ConsoleHost
PSReadLine Version: 2.2.6
PSReadLine EditMode: Windows
OS: 10.0.22621.1 (WinBuild.160101.0800)
BufferWidth: 345
BufferHeight: 47
Steps to reproduce

Select multi-line text, like this one:

function Get-StrictMode {
  # returns the currently set StrictMode version 1, 2, 3
  # or 0 if StrictMode is off.
  try { $xyz = @(1); $null = ($null -eq $xyz[2]) }
  catch { return 3 }

  try { 'Not-a-Date'.Year }
  catch { return 2 }

  try { $null = ($undefined -gt 1) }
  catch { return 1 }

  return 0
}

Paste it into a session that has Oh-my-posh loaded with TransientPrompt enabled, the output is this:

[2022-10-08 15:48:44]❯ function Get-StrictMode {                                                                                                                                                                                                                                                                                                         >   # returns the currently set StrictMode version 1, 2, 3                                                                                                                                                                                                                                                                                               >   # or 0 if StrictMode is off.                                                                                                                                                                                                                                                                                                                         
>   try { $xyz = @(1); $null = ($null -eq $xyz[2]) }, 2, 3                                                                                                                                                                                                                                                                                               
>   catch { return 3 }de is off.
>   try { $xyz = @(1); $null = ($null -eq $xyz[2]) }
>   try { 'Not-a-Date'.Year }
>   catch { return 2 }
>   try { 'Not-a-Date'.Year }
>   try { $null = ($undefined -gt 1) }
>   catch { return 1 }
>   try { $null = ($undefined -gt 1) }
>   return 0return 1 }
> }
Expected behavior

Output displayed as-is

Actual behavior

On line 4, the text "de is off." is repeated from line 2. I could observe this on other terminals (Windows Terminal) with multi-line text as well.

This has no impact on the execution, but is a visual bug on the terminal.

Ngôn ngữ chính
C#
Star
4.4k
Fork
341
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

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 PowerShell/PSReadLine

Tất cả issue của PowerShell/PSReadLine

Issue tương tự

Thêm issue về C#

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.