aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Goodlad2010-11-29 13:22:18 +1100
committerMike McQuaid2010-12-02 00:43:19 +0000
commit8da75a4ce609edb6829b08ea2f2213aee36f0695 (patch)
tree64aad731ee78367d1bdc8cf688561cec9449faf0
parent7e7e2c4219644eb725443d0c21cac41102b463ff (diff)
downloadhomebrew-8da75a4ce609edb6829b08ea2f2213aee36f0695.tar.bz2
Make tmux work with osx pasteboard
Via https://gist.github.com/644805 Uses the private api call _vprocmgr_detach_from_console similar to Apple's patch to GNU screen Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
-rw-r--r--Library/Formula/tmux.rb32
1 files changed, 32 insertions, 0 deletions
diff --git a/Library/Formula/tmux.rb b/Library/Formula/tmux.rb
index f3cc8c42e..589a18188 100644
--- a/Library/Formula/tmux.rb
+++ b/Library/Formula/tmux.rb
@@ -7,6 +7,13 @@ class Tmux <Formula
depends_on 'libevent'
+ def patches
+ # Patch originally from Macports ticket #18357
+ # Committed in Macports rev 58563
+ # https://trac.macports.org/changeset/58563
+ { :p1 => DATA }
+ end
+
def install
ENV['PREFIX'] = prefix
system "./configure"
@@ -21,3 +28,28 @@ class Tmux <Formula
system "make install"
end
end
+
+__END__
+diff -Nur tmux-1.3/server.c tmux-1.3.new/server.c
+--- tmux-1.3/server.c 2010-06-23 09:21:39.000000000 +1000
++++ tmux-1.3.new/server.c 2010-11-29 08:48:48.000000000 +1100
+@@ -35,6 +35,8 @@
+ #include <time.h>
+ #include <unistd.h>
+
++void *_vprocmgr_detach_from_console(unsigned int flags);
++
+ #include "tmux.h"
+
+ /*
+@@ -137,8 +139,8 @@
+ * Must daemonise before loading configuration as the PID changes so
+ * $TMUX would be wrong for sessions created in the config file.
+ */
+- if (daemon(1, 0) != 0)
+- fatal("daemon failed");
++ if (_vprocmgr_detach_from_console(0) != NULL)
++ fatalx("_vprocmgr_detach_from_console failed");
+
+ /* event_init() was called in our parent, need to reinit. */
+ if (event_reinit(ev_base) != 0)