-
Notifications
You must be signed in to change notification settings - Fork 797
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How can I disable Windows sounds in Bash? #715
Comments
I use |
|
bennyyip's suggestion to mute Console Window Host is the only thing that works for me. But I still want a sound, just a nicer one. I think it's being played by the Beep Driver, which in Windows 10 plays the event "Critical Stop" which is "Windows Foreground.wav". It's a singularly horrible sound to have mapped to a console bell that rings every time bash completion is unhappy. You can set which sound is played in the Sound Driver (Windows Ding is better). Perhaps someone on the WSL team is equally annoyed by the sound and will sneak in a more mellifluous user experience. |
The solution of @xiuluo worked for me !!! |
I wanted to let folks know that @osimons solution regarding bell in .inputrc worked for me after restarting bash/Ubuntu. I'm using Windows 10 Insider Preview 16278. As of July 10, 2017 Ubunto Linux is now Available in the Windows Store. As such I could see this page getting some more attention in the near future. |
In Linux, I usually disable the audible bell and enable the visual bell by adding While this works in WSL in term of silencing the audible bell, it does not enable the visual bell. I wonder whether this is worth filing a separate bug... |
This is not a bug, this is a feature. :-) For bash (and other readline-based programs) use: For vim use: However, visual bells do not seem to work. I will file another bug report. |
This file can be moved to $HOME/.inputrc or as /etc./inputrc in order to silence the terminal bell. This is partcularly useful when using the Windows Subsystem for Linux since a rather jarring sound occurs upon every incorrect terminal completion, etc. microsoft/WSL#715 (comment)
Great solution @yoctozepto. The problem with @xiuluo 's solution is that it is disabling the 'critical stop' sound for every application on the machine. It is unclear which key combination @xiuluo is using to produce this noise but my problem in WSL/VIM was coming from TAB autocomplete and was playing the 'Default Beep' sound. @yoctozepto 's solution fixes all sounds on vim (tab complete, ESC etc) and in bash whilst leaving them available outside. |
@eL0ck Yea, that fixed mine too. But in vim i can still hear that annoying sound :( |
@mbpakalin Make sure vim read ~/.vimrc successfuly. |
@yoctozepto I forgot adding the .vimrc stuff, now i added |
@yoctozepto solution works for me. I added set bell-style visible |
I added the same |
This is a feature but can we have a feature to disable this feature? Particularly, can we have an option in the WSL itself to permanently remove the "hardware support" presented to the sub system? So that disabling this sound will no longer be system and software dependent? |
@yoctozepto solution kind of works, until you do for example a |
"Console Window Host" doesn't show up in my volume mixer. I edited the file for "Windows Default Beep" (not Critical Stop) to fix it. |
Tired of fixing this.. |
Yep, can we have an option to shut this up please, and store the setting from the Windows side of things please? |
Bro, you can disable all systems sounds via system settings. I think we don't need it in 2022. 😉 |
diff --git a/test.py b/test.py deleted file mode 100644 index 395d9f6..0000000 --- a/test.py +++ /dev/null @@ -1,109 +0,0 @@ -import newspaper -from markdownify import markdownify as md - -def fetch_and_parse(url): - # Create a new article object - article = newspaper.Article(url) - - # Download and parse the article - article.download() - article.parse() - - # Get the markdown content from the parsed HTML article - markdown_content = md(article.text) - - return markdown_content - - -def return_urls_from_news_site(site: str): - # Return a list of urls from a news site - # fetch paper from newspaper3k - article_urls = [] - try: - paper = newspaper.build(site, memoize_articles=False) - for article in paper.articles: - article_urls.append(article.url) - return article_urls - except: - return article_urls - -def extract_from_website_using_newspaper(url: str): - """return a string with fulltext from a url""" - article = newspaper.Article(url) - article.download() - article.parse() - return article -def extract_from_website_using_beautifulsoup(url: str): - """return a string with paragraphs and h1-h5 from a url""" - from bs4 import BeautifulSoup - import requests - page = requests.get(url) - soup = BeautifulSoup(page.content, 'html.parser') - # remove all script and style elements - for script in soup(["script", "style","head"]): - script.decompose() # rip it out - # all elements and extract elements that contain "text" - strip = [r'nav',r'head', r'foot',r'menu'] - import re - found_elements = [] - for elem in soup.find_all(): - # find items with class attribute that contains "text" - #print(elem.attrs) - for s in strip: - if elem.has_attr('class'): - for _class in elem['class']: - if re.search(s, _class) is not None: - #print(f"found {s} in {_class}") - found_elements.append(elem) - continue - for elem in found_elements: - elem.decompose() - del found_elements - # get text - text = soup.get_text() - # break into lines and remove leading and trailing space on each - lines = (line.strip() for line in text.splitlines()) - # break multi-headlines into a line each - chunks = (phrase.strip() for line in lines for phrase in line.split(" ")) - # drop blank lines - text = '\n'.join(chunk for chunk in chunks if chunk) - class article: - def __init__(self, title, text, keywords=[], authors=[]): - self.title = title - self.text = text - self.summary = text[:100] - self.keywords = keywords - self.authors = authors - bsarticle = article("", text) - return bsarticle - -# Test function: -#url = "https://medium.com/macoclock/9-new-must-have-macos-productivity-apps-for-daily-usage-fec955b1510c" -#content = fetch_and_parse(url) -#print(content) - -#article = extract_from_website_using_newspaper(url) -#print(f"{article.title}: {article.summary} by {article.authors} keywords: {','.join(article.keywords)}\n{article.text}") -def compare_extract(url: str): - articlenp = extract_from_website_using_newspaper(url) - articlebs = extract_from_website_using_beautifulsoup(url) - - print("np article:") - print(articlenp.text) - print("bs article:") - print(articlebs.text) - - print(f"np len: {len(articlenp.text)}") - print(f"bs len: {len(articlebs.text)}") - -url = "https://www.dr.dk/nyheder/" -#urls = return_urls_from_news_site(url) -#print(urls) - -#url = "https://www.dr.dk/nyheder/seneste/gennemsnitstemperatur-maalt-til-det-hoejeste-nogensinde-anden-dag-i-traek" -#url = "https://docs.aws.amazon.com/IAM/latest/UserGuide/console_search.html" -url = "https://ekstrabladet.dk/nyheder/samfund/soedestof-paa-kraeftliste-slut-med-coca-cola-zero/9847762" -#url = "https://stackoverflow.com/questions/36724209/disable-beep-in-wsl-terminal-on-windows-10" -#url = "microsoft/WSL#715 (comment)" -#for url in urls: -compare_extract(url)
If I try to move the cursor passed the end of a block of text, Windows chimes a sound. How can I disable all such sounds?
The text was updated successfully, but these errors were encountered: