Set-PSReadLineOption BellStyle should have an option for an actual ASCII 7 bell

Đang mở
#4,766 1 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ó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
35/100
Loại issue
Tính năng
Độ rõ ràng
Khá 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

Start by locating Set-PSReadLineOption BellStyle and the existing Audible, Visual, and None handling. Review the linked Windows Terminal bell-style documentation alongside the current behavior. Done should include a selectable style that emits an ASCII 0x07 bell and a clear decision about the proposed default change.

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

Mô tả

Issue-Enhancement Needs-Triage :mag:
Prerequisites
  • Write a descriptive title.
Description of the new feature/enhancement

Hello,

I just realized this today but, even in the latest PSReadLine 2.3.6 when I configure the "Bell notification style" in Windows Terminal to, for example, ["window", "taskbar"] (briefly flash the console screen + taskbar icon) instead of audible (make the irritating pcspeaker noise) PSReadLine does not honor this setting - it still makes a sharp blip-like sound. I'm guessing PSReadLine does not emit an actual ASCII 0x7 BELL but rather implements its own sound playback.

This is very bad because:

  1. For the user it is unexpected behavior for a program emitting a BELL to not adhere to the terminals configured treatment of BELL signals
  2. PSReadLines only BELL configuration options are "Audible" (default), "Visual" and "None" but the hosting terminal application can have more abilities to indicate a BELL
  3. PSReadLine in practice really only has "Audible" and "None" as BellStyles because, at least on my machine, "Visual" does absolutely nothing making it equivalent to "None"
  4. Whatever custom BELL implementation PSReadLine has, it's got to be more lines of code than putchar(7); arguably making it a code smell and unnecessary bloat?
Proposed technical implementation details (optional)

I propose to add a BellStyle option that just makes PSReadLine, well, emit an actual 0x07 BELL. Also, I would very much like for this BellStyle (call it -BellStyle ASCIIBell or whatever) to be the new default BellStyle. Users who unironically prefer the eardrum-shattering, high-pitched blip of the current implementation can always change it back to Audible.

EDIT: Link to Windows Terminal BELL style configuration docs: https://learn.microsoft.com/en-us/windows/terminal/customize-settings/profile-advanced#bell-notification-style

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.