<div dir="ltr"><div class="gmail_default" style="font-family:monospace">Hello <a class="gmail_plusreply" id="plusReplyChip-0" href="mailto:core-libs-dev@openjdk.org" tabindex="-1">@core-libs-dev</a>,</div><div class="gmail_default" style="font-family:monospace"><br></div><div class="gmail_default" style="font-family:monospace">In languages such as C and Python, the escape sequence \a corresponds to the <a href="https://en.wikipedia.org/wiki/Bell_character">"Bell" character</a>, commonly used to trigger the system default bell or notification, even producing a small flash or audio. For example, on Windows 11, printing the Bell character causes an audio notification to play, and whatever application that printed it will flash orange on the taskbar on the bottom of my screen.</div><div class="gmail_default" style="font-family:monospace"><br></div><div class="gmail_default" style="font-family:monospace">This is super useful for notifying the end of a process that you aren't actively monitoring. Like I mentioned, not only does it make an audio notification, but it also causes the taskbar icon to flash. Great for multitasking.</div><div class="gmail_default" style="font-family:monospace"><br></div><div class="gmail_default" style="font-family:monospace">Since this is something useful (and it already exists in several other languages), could we add it to Java too?</div><div class="gmail_default" style="font-family:monospace"><br></div><div class="gmail_default" style="font-family:monospace">We can already do this now, with the following command (try it in JShell!).</div><div class="gmail_default" style="font-family:monospace"><br></div><div class="gmail_default" style="font-family:monospace">final char bell = 7;
</div><div class="gmail_default" style="font-family:monospace">Thread.sleep(java.time.Duration.ofSeconds(5));</div><div class="gmail_default" style="font-family:monospace">System.out.println(bell);</div><div class="gmail_default" style="font-family:monospace"><br></div><div class="gmail_default" style="font-family:monospace">Try and switch to a different window, and you will see that, not only will the bell sound, but you are likely to have your taskbar icon flash.</div><div class="gmail_default" style="font-family:monospace"><br></div><div class="gmail_default" style="font-family:monospace">So, could we have \a as an escape sequence character?</div><div class="gmail_default" style="font-family:monospace"><br></div><div class="gmail_default" style="font-family:monospace">If not that, could we have it be a static field or static method in some class? Maybe Character.bell() or System.bell()? I think it's useful enough to deserve it.</div><div class="gmail_default" style="font-family:monospace"><br></div><div class="gmail_default" style="font-family:monospace">Of course, if none of that makes sense, and we should just stick to typing char bell = 7 and just using that, that's fine too. But please lmk either way.</div><div class="gmail_default" style="font-family:monospace"><br></div><div class="gmail_default" style="font-family:monospace">Thank you for your time and consideration.</div><div class="gmail_default" style="font-family:monospace">David Alayachew</div></div>