1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Git Bash for WindowsやVSCodeでベル(\a)音を鳴らす

Posted at

bashではechoコマンドでベル音を出力することができます(シェルスクリプトが完了した際に音で通知させることができる)

echo -e "\a"
  • echo はデフォルトでエスケープシーケンスを解釈しないため、-eをつける必要があります

上記のコマンドを実行しても音が鳴らない場合

Git Bashや、Windows Terminal側でベル音が鳴らないように設定されているため、下記設定を確認します

①「~.inputrc」ファイルを作成して、ベル出力を有効にする

ホームディレクトリに.inputrcを作成して、下記内容を書きこみます

# none, visible or audible
set bell-style audible

下記ファイルを直接書き換えることで、変更も可能です(読み取り専用なので、メモ帳を管理者権限で起動して編集する)
"C:\Program Files\Git\etc\inputrc"

②Windows Terminalのベル設定を有効にする

「設定」⇒「Git Bash」⇒「詳細設定」の順で画面を開き、ベルの設定を変更します(音によるチャイム、にチェックをつけます)

image

Visual Studio CodeのターミナルでBellを鳴らす

VSCodeはベルがデフォルトでOffになっているので、設定を変更します

  • 「設定」画面でaccessibility bellを入力して設定を表示させる
  • 「sound」をonに変更して保存する

image

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?