Skip to content

Commit 6b6f2d9

Browse files
committed
only kill current context if is len > 1
1 parent 434dbf4 commit 6b6f2d9

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

rio/src/screen/context.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,12 +347,16 @@ impl<T: EventListener + Clone + std::marker::Send + 'static> ContextManager<T> {
347347

348348
#[inline]
349349
pub fn kill_current_context(&mut self) {
350+
if self.contexts.len() <= 1 {
351+
self.current_index = 0;
352+
return;
353+
}
354+
350355
let index_to_remove = self.current_index;
351356

352357
#[cfg(not(target_os = "windows"))]
353358
{
354359
let pid = self.contexts[index_to_remove].shell_pid;
355-
println!("closing pid {}", pid);
356360
if pid > 0 {
357361
teletypewriter::kill_pid(pid as i32);
358362
}

0 commit comments

Comments
 (0)