diff options
author | Eric Wong <normalperson@yhbt.net> | 2013-08-28 09:21:11 +0000 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2013-08-28 09:23:08 +0000 |
commit | 0f345d3f3f8247fbc18f83748ea25c9f4731eaa5 (patch) | |
tree | fb90556d8af729fbfccb040b6e1fc760c551147e /bin | |
parent | defbf90124f4bb94464f88ecd05bdd55f0578d0b (diff) | |
download | dtas-0f345d3f3f8247fbc18f83748ea25c9f4731eaa5.tar.gz |
Lightly-tested, but this seems to work.
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/dtas-console | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/bin/dtas-console b/bin/dtas-console index f60ae13..3b246bd 100755 --- a/bin/dtas-console +++ b/bin/dtas-console @@ -6,14 +6,17 @@ # Note: no idea what I'm doing, especially w.r.t. curses require 'dtas/unix_client' require 'dtas/rg_state' +require 'dtas/sigevent' require 'curses' require 'yaml' +se = DTAS::Sigevent.new +trap(:WINCH) { se.signal } w = DTAS::UNIXClient.new w.req_ok('watch') c = DTAS::UNIXClient.new cur = YAML.load(c.req('current')) -readable = [ w, $stdin ] +readable = [ se, w, $stdin ] # current rg mode rg_mode = DTAS::RGState::RG_MODE.keys.unshift("off") @@ -146,6 +149,9 @@ begin r = IO.select(readable, nil, nil, current ? interval : nil) or next r[0].each do |io| case io + when se + se.readable_iter {} # noop, just consume the event + Curses.clear when w event = w.res_wait events << "#{Time.now.strftime(tfmt)} #{event}" |