File tree 2 files changed +5
-15
lines changed
2 files changed +5
-15
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ fn main() -> Result<()> {
33
33
utils:: logging:: init_logger ( log:: LevelFilter :: Debug , std:: ffi:: OsStr :: new ( "debug.log" ) ) ?;
34
34
}
35
35
36
+ // Read from config file.
36
37
let config_path = read_config ( matches. value_of ( "config_location" ) )
37
38
. context ( "Unable to access the given config file location." ) ?;
38
39
let mut config: Config = create_or_get_config ( & config_path)
@@ -58,7 +59,7 @@ fn main() -> Result<()> {
58
59
canvas:: Painter :: init ( widget_layout, & config, get_color_scheme ( & matches, & config) ?) ?;
59
60
60
61
// Check if the current environment is in a terminal.
61
- if !check_if_terminal_and_wait ( ) {
62
+ if !check_if_terminal ( ) {
62
63
return Ok ( ( ) ) ;
63
64
}
64
65
@@ -114,7 +115,6 @@ fn main() -> Result<()> {
114
115
enable_raw_mode ( ) ?;
115
116
116
117
let mut terminal = Terminal :: new ( CrosstermBackend :: new ( stdout_val) ) ?;
117
-
118
118
terminal. clear ( ) ?;
119
119
terminal. hide_cursor ( ) ?;
120
120
Original file line number Diff line number Diff line change @@ -274,26 +274,16 @@ pub fn cleanup_terminal(
274
274
Ok ( ( ) )
275
275
}
276
276
277
- /// Check and report to the user if the current environment is not a terminal. If it isn't a terminal, wait
278
- /// for user input and return `false` if the caller should bail. Otherwise, return `true`.
279
- pub fn check_if_terminal_and_wait ( ) -> bool {
277
+ /// Check and report to the user if the current environment is not a terminal.
278
+ pub fn check_if_terminal ( ) -> bool {
280
279
use crossterm:: tty:: IsTty ;
281
280
282
281
let out = stdout ( ) ;
283
282
if !out. is_tty ( ) {
284
283
println ! (
285
284
"Warning: bottom is not being output to a terminal. Things might not work properly."
286
285
) ;
287
- println ! ( "Press Ctrl-c or input q to exit, or any other key to continue." ) ;
288
-
289
- match read ( ) . unwrap ( ) {
290
- Event :: Key ( event) => match event. modifiers {
291
- KeyModifiers :: NONE => !matches ! ( event. code, KeyCode :: Char ( 'q' ) ) ,
292
- KeyModifiers :: CONTROL => !matches ! ( event. code, KeyCode :: Char ( 'c' ) ) ,
293
- _ => true ,
294
- } ,
295
- _ => true ,
296
- }
286
+ false
297
287
} else {
298
288
true
299
289
}
You can’t perform that action at this time.
0 commit comments