Skip to content

Commit e6afc3f

Browse files
author
Your Name
committed
#590: Version 2
1 parent 754cb2f commit e6afc3f

3 files changed

Lines changed: 14 additions & 1 deletion

File tree

cecli/args.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1115,6 +1115,16 @@ def get_parser(default_config_files, git_root):
11151115
" specified, a default command for your OS may be used."
11161116
),
11171117
)
1118+
group.add_argument(
1119+
"--notification-bell",
1120+
action=argparse.BooleanOptionalAction,
1121+
default=True,
1122+
help=(
1123+
"Allow notification commands to produce an audible bell. When enabled, command"
1124+
" output is not suppressed so terminal bell escape sequences can ring through"
1125+
" (default: True)"
1126+
),
1127+
)
11181128
group.add_argument(
11191129
"--command-prefix",
11201130
default=None,

cecli/io.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,7 @@ def __init__(
367367
root=".",
368368
notifications=False,
369369
notifications_command=None,
370+
notification_bell=True,
370371
verbose=False,
371372
):
372373
self.console = Console()
@@ -384,6 +385,7 @@ def __init__(
384385
self.multiline_mode = multiline_mode
385386
self.bell_on_next_input = False
386387
self.notifications = notifications
388+
self.notification_bell = notification_bell
387389
self.verbose = verbose
388390
self.profile_start_time = None
389391
self.profile_last_time = None
@@ -1757,7 +1759,7 @@ def _send_notification(self):
17571759
"shell": True,
17581760
}
17591761

1760-
if not is_bell_cmd:
1762+
if not (is_bell_cmd or self.notification_bell):
17611763
kwargs["stdout"] = subprocess.DEVNULL
17621764
kwargs["stderr"] = subprocess.DEVNULL
17631765

cecli/main.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -697,6 +697,7 @@ def get_io(pretty):
697697
multiline_mode=args.multiline,
698698
notifications=args.notifications,
699699
notifications_command=args.notifications_command,
700+
notification_bell=args.notification_bell,
700701
verbose=args.verbose,
701702
)
702703

0 commit comments

Comments
 (0)