From 09b24e9888f484e130935238847aaa8d7c88a2eb Mon Sep 17 00:00:00 2001 From: David Goodlad Date: Mon, 29 Nov 2010 13:22:18 +1100 Subject: [PATCH] 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 --- Formula/tmux.rb | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/Formula/tmux.rb b/Formula/tmux.rb index f3cc8c42e89..589a18188ff 100644 --- a/Formula/tmux.rb +++ b/Formula/tmux.rb @@ -7,6 +7,13 @@ class Tmux DATA } + end + def install ENV['PREFIX'] = prefix system "./configure" @@ -21,3 +28,28 @@ class Tmux + #include + ++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)