@@ -22,6 +22,7 @@ use nextest_runner::{
22
22
} ,
23
23
double_spawn:: DoubleSpawnInfo ,
24
24
errors:: WriteTestListError ,
25
+ input:: InputHandlerKind ,
25
26
list:: {
26
27
BinaryList , OutputFormat , RustTestArtifact , SerializableFormat , TestExecuteContext ,
27
28
TestList ,
@@ -986,6 +987,13 @@ struct TestReporterOpts {
986
987
#[ arg( long, env = "NEXTEST_HIDE_PROGRESS_BAR" , value_parser = BoolishValueParser :: new( ) ) ]
987
988
hide_progress_bar : bool ,
988
989
990
+ /// Disable handling of input keys from the terminal.
991
+ ///
992
+ /// By default, when running a terminal, nextest accepts the `t` key to dump
993
+ /// test information. This flag disables that behavior.
994
+ #[ arg( long, env = "NEXTEST_NO_INPUT_HANDLER" , value_parser = BoolishValueParser :: new( ) ) ]
995
+ no_input_handler : bool ,
996
+
989
997
/// Format to use for test results (experimental).
990
998
#[ arg(
991
999
long,
@@ -1780,12 +1788,16 @@ impl App {
1780
1788
. color
1781
1789
. should_colorize ( supports_color:: Stream :: Stderr ) ;
1782
1790
1783
- let mut reporter = reporter_opts
1784
- . to_builder ( no_capture, should_colorize)
1785
- . set_verbose ( self . base . output . verbose )
1786
- . build ( & test_list, & profile, output, structured_reporter) ;
1791
+ let signal_handler = SignalHandlerKind :: Standard ;
1792
+ let input_handler = if reporter_opts. no_input_handler {
1793
+ InputHandlerKind :: Noop
1794
+ } else {
1795
+ // This means that the input handler determines whether it should be
1796
+ // enabled.
1797
+ InputHandlerKind :: Standard
1798
+ } ;
1787
1799
1788
- let handler = SignalHandlerKind :: Standard ;
1800
+ // Make the runner.
1789
1801
let runner_builder = match runner_opts. to_builder ( cap_strat) {
1790
1802
Some ( runner_builder) => runner_builder,
1791
1803
None => {
@@ -1798,11 +1810,18 @@ impl App {
1798
1810
& test_list,
1799
1811
& profile,
1800
1812
cli_args,
1801
- handler,
1813
+ signal_handler,
1814
+ input_handler,
1802
1815
double_spawn. clone ( ) ,
1803
1816
target_runner. clone ( ) ,
1804
1817
) ?;
1805
1818
1819
+ // Make the reporter.
1820
+ let mut reporter = reporter_opts
1821
+ . to_builder ( no_capture, should_colorize)
1822
+ . set_verbose ( self . base . output . verbose )
1823
+ . build ( & test_list, & profile, output, structured_reporter) ;
1824
+
1806
1825
configure_handle_inheritance ( no_capture) ?;
1807
1826
let run_stats = runner. try_execute ( |event| {
1808
1827
// Write and flush the event.
0 commit comments