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

未关闭
#4,766 1 条评论 2 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
35/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
停滞
技术栈
csharp, powershell
领域
cli

调研方向

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.

由索引模型根据 Issue 内容生成。

描述

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

主要语言
C#
星标
4.4k
派生
341
PR 合并指标
30 天内没有已合并 PR

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

PowerShell/PSReadLine 的其他 Issue

查看 PowerShell/PSReadLine 的全部 Issue

相似的 Issue

更多 C# Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。