gpt4 book ai didi

shell - Emacs shell 中的钟声

转载 作者:行者123 更新时间:2023-12-04 04:49:47 25 4
gpt4 key购买 nike

M-x shell ,当打印铃字符时(例如在 echo -e '\a' 中),它不会发出任何噪音并打印出 ^G .它是否可以像在普通终端中那样真正响铃?

最佳答案

通过评估以下代码,当 control-G 字符发送到 shell 时,我能够使铃声响起:

(defun beep-on-alert-char (str)
(if (string-match-p "\x7" str) (beep)))

(add-hook 'comint-output-filter-functions 'beep-on-alert-char)

关于shell - Emacs shell 中的钟声,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17606977/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com