sup

A curses threads-with-tags style email client

sup.git

git clone https://supmua.dev/git/sup/
commit 3d11ce94a2a4184c48186a586dc024e58a9f8c10
parent 09e6a71e232d2d3352fe45b13789c3441e3ac937
Author: William Morgan <wmorgan-sup@masanjin.net>
Date:   Fri, 30 Oct 2009 18:06:35 -0400

Merge branch 'no-mailcap-on-darwin' into next

Diffstat:
M lib/sup/message-chunks.rb | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/lib/sup/message-chunks.rb b/lib/sup/message-chunks.rb
@@ -132,7 +132,12 @@ EOS
     def initial_state; :open end
     def viewable?; @lines.nil? end
     def view_default! path
-      cmd = "/usr/bin/run-mailcap --action=view '#{@content_type}:#{path}'"
+      case Config::CONFIG['arch']
+        when /darwin/
+          cmd = "open '#{path}'"
+        else
+          cmd = "/usr/bin/run-mailcap --action=view '#{@content_type}:#{path}'"
+      end
       debug "running: #{cmd.inspect}"
       BufferManager.shell_out(cmd)
       $? == 0