summaryrefslogtreecommitdiffstats
path: root/src/event.rs
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2022-01-02 20:10:25 -0500
committerJesse Luehrs <doy@tozt.net>2022-01-02 20:10:25 -0500
commitb6ce31e422f439149c0f03ee5f4f72eac4cb78c6 (patch)
tree9978608fb8ba6bb19713f85eb7b23a4c22f968c8 /src/event.rs
parent94faf261af579dcfcd0e41ee9be62b5843870b4b (diff)
downloadnbsh-b6ce31e422f439149c0f03ee5f4f72eac4cb78c6.tar.gz
nbsh-b6ce31e422f439149c0f03ee5f4f72eac4cb78c6.zip
rename some of the other events
Diffstat (limited to 'src/event.rs')
-rw-r--r--src/event.rs28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/event.rs b/src/event.rs
index 4280185..7adc2e7 100644
--- a/src/event.rs
+++ b/src/event.rs
@@ -2,8 +2,8 @@
pub enum Event {
Key(textmode::Key),
Resize((u16, u16)),
- ProcessOutput,
- ProcessExit,
+ PtyOutput,
+ PtyClose,
ClockTimer,
}
@@ -53,8 +53,8 @@ impl Reader {
struct Pending {
key: std::collections::VecDeque<textmode::Key>,
size: Option<(u16, u16)>,
- process_output: bool,
- process_exit: bool,
+ pty_output: bool,
+ pty_close: bool,
clock_timer: bool,
done: bool,
}
@@ -68,8 +68,8 @@ impl Pending {
self.done
|| !self.key.is_empty()
|| self.size.is_some()
- || self.process_output
- || self.process_exit
+ || self.pty_output
+ || self.pty_close
|| self.clock_timer
}
@@ -83,9 +83,9 @@ impl Pending {
if let Some(size) = self.size.take() {
return Some(Event::Resize(size));
}
- if self.process_exit {
- self.process_exit = false;
- return Some(Event::ProcessExit);
+ if self.pty_close {
+ self.pty_close = false;
+ return Some(Event::PtyClose);
}
if self.clock_timer {
self.clock_timer = false;
@@ -94,9 +94,9 @@ impl Pending {
// process_output should be last because it will often be the case
// that there is ~always new process output (cat on large files, yes,
// etc) and that shouldn't prevent other events from happening
- if self.process_output {
- self.process_output = false;
- return Some(Event::ProcessOutput);
+ if self.pty_output {
+ self.pty_output = false;
+ return Some(Event::PtyOutput);
}
unreachable!()
}
@@ -105,8 +105,8 @@ impl Pending {
match event {
Some(Event::Key(key)) => self.key.push_back(key.clone()),
Some(Event::Resize(size)) => self.size = Some(*size),
- Some(Event::ProcessOutput) => self.process_output = true,
- Some(Event::ProcessExit) => self.process_exit = true,
+ Some(Event::PtyOutput) => self.pty_output = true,
+ Some(Event::PtyClose) => self.pty_close = true,
Some(Event::ClockTimer) => self.clock_timer = true,
None => self.done = true,
}