about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2009-06-12 18:50:29 +0200
committerhut <hut@lavabit.com>2009-06-12 18:50:29 +0200
commit46069e7ee321ad035c5b1964026aa34fb5c06974 (patch)
treea370bad43668aedb5bbb7f281bfffdb7e4c35ebe
parentad97002ee5f34cf702419411e871e13814076a51 (diff)
downloadranger-46069e7ee321ad035c5b1964026aa34fb5c06974.tar.gz
cleanup + removed relics from the dark ages
-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