@@ -900,6 +900,7 @@ def prompt(
900
900
accept_default : bool = False ,
901
901
pre_run : Optional [Callable [[], None ]] = None ,
902
902
set_exception_handler : bool = True ,
903
+ handle_sigint : bool = True ,
903
904
in_thread : bool = False ,
904
905
) -> _T :
905
906
"""
@@ -1028,10 +1029,12 @@ class itself. For these, passing in ``None`` will keep the current
1028
1029
# dumb prompt.
1029
1030
if self ._output is None and is_dumb_terminal ():
1030
1031
with self ._dumb_prompt (self .message ) as dump_app :
1031
- return dump_app .run (in_thread = in_thread )
1032
+ return dump_app .run (in_thread = in_thread , handle_sigint = handle_sigint )
1032
1033
1033
1034
return self .app .run (
1034
- set_exception_handler = set_exception_handler , in_thread = in_thread
1035
+ set_exception_handler = set_exception_handler ,
1036
+ in_thread = in_thread ,
1037
+ handle_sigint = handle_sigint ,
1035
1038
)
1036
1039
1037
1040
@contextmanager
@@ -1132,6 +1135,7 @@ async def prompt_async(
1132
1135
accept_default : bool = False ,
1133
1136
pre_run : Optional [Callable [[], None ]] = None ,
1134
1137
set_exception_handler : bool = True ,
1138
+ handle_sigint : bool = True ,
1135
1139
) -> _T :
1136
1140
1137
1141
if message is not None :
@@ -1219,9 +1223,11 @@ async def prompt_async(
1219
1223
# dumb prompt.
1220
1224
if self ._output is None and is_dumb_terminal ():
1221
1225
with self ._dumb_prompt (self .message ) as dump_app :
1222
- return await dump_app .run_async ()
1226
+ return await dump_app .run_async (handle_sigint = handle_sigint )
1223
1227
1224
- return await self .app .run_async (set_exception_handler = set_exception_handler )
1228
+ return await self .app .run_async (
1229
+ set_exception_handler = set_exception_handler , handle_sigint = handle_sigint
1230
+ )
1225
1231
1226
1232
def _add_pre_run_callables (
1227
1233
self , pre_run : Optional [Callable [[], None ]], accept_default : bool
0 commit comments