| 145 | |
| 146 | #[cfg(debug_assertions)] |
| 147 | fn check_debug() { |
| 148 | if env::var("DEBUG_DSC").is_ok() { |
| 149 | eprintln!("attach debugger to pid {} and press a key to continue", std::process::id()); |
| 150 | loop { |
| 151 | let event = match event::read() { |
| 152 | Ok(event) => event, |
| 153 | Err(err) => { |
| 154 | eprintln!("Failed to read event: {err}"); |
| 155 | break; |
| 156 | } |
| 157 | }; |
| 158 | if let event::Event::Key(key) = event { |
| 159 | // workaround bug in 0.26+ https://github.com/crossterm-rs/crossterm/issues/752#issuecomment-1414909095 |
| 160 | if key.kind == event::KeyEventKind::Press { |
| 161 | break; |
| 162 | } |
| 163 | } |
| 164 | } |
| 165 | } |
| 166 | } |
| 167 | |
| 168 | // Check if the dsc binary parent process is WinStore.App or Explorer.exe |
| 169 | #[cfg(windows)] |