about summary refs log tree commit diff stats
path: root/code/fm/fm.rb
diff options
context:
space:
mode:
Diffstat (limited to 'code/fm/fm.rb')
-rw-r--r--code/fm/fm.rb19
1 files changed, 8 insertions, 11 deletions
diff --git a/code/fm/fm.rb b/code/fm/fm.rb
index 1bf74081..6d0cc239 100644
--- a/code/fm/fm.rb
+++ b/code/fm/fm.rb
@@ -114,10 +114,15 @@ module Fm
 		sleep 0.2
 	end
 
+	def terminal_killed?
+#		`ps ho tname --pid #{Process.pid}`.strip == '?'
+		Process.ppid == 1
+	end
+
 	def main_loop
 		bool = false
 		while true
-			exit if Process.ppid == 1
+			exit if terminal_killed?
 			if @pwd.size == 0 or @pwd.pos < 0
 				@pwd.pos = 0
 			elsif @pwd.pos >= @pwd.size - 1
@@ -134,16 +139,8 @@ module Fm
 			end
 
 			begin
-#				unless bool
-#					bool = true
-					key = geti
-#				else
-#					key = geti
-#					key = 'j'
-#				end
-#				@mutex.synchronize {
-					press(key)
-#				}
+				key = geti
+				press(key)
 			rescue Interrupt
 				on_interrupt
 			end
6:42 -0700 committer Kartik K. Agaram <vc@akkartik.com> 2015-05-18 22:26:42 -0700 1404 - undefined-behavior checks using clang' href='/akkartik/mu/commit/test_all_layers?h=main&id=b31aaa21d5aa0e25091ee51d5bfff561ec929561'>b31aaa21 ^
72d7e2d0 ^
1
2
3
4
5
6
7
8
9
10
11
12