mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-03 16:46:18 +00:00 
			
		
		
		
	Add a small dance to daemon() to reattach tmux to the user's namespace (which
allows access to the clipboard) on OS X 10.10 and above.
Chis Johnsen has done much work on and documentation of this issue, the code is
copied (with some tweaks) from his reattach-to-user-namespace at:
    https://github.com/ChrisJohnsen/tmux-MacOSX-pasteboard
Tested by Enrico Ghirardi.
Will see how this goes, if it breaks stuff it might go away again.
			
			
This commit is contained in:
		@@ -28,12 +28,18 @@
 | 
			
		||||
 * SUCH DAMAGE.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#include <sys/types.h>
 | 
			
		||||
 | 
			
		||||
#include <fcntl.h>
 | 
			
		||||
#include <unistd.h>
 | 
			
		||||
#include <stdlib.h>
 | 
			
		||||
 | 
			
		||||
#include "compat.h"
 | 
			
		||||
 | 
			
		||||
#ifdef __APPLE__
 | 
			
		||||
extern void daemon_darwin(void);
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
int
 | 
			
		||||
daemon(int nochdir, int noclose)
 | 
			
		||||
{
 | 
			
		||||
@@ -61,5 +67,9 @@ daemon(int nochdir, int noclose)
 | 
			
		||||
		if (fd > 2)
 | 
			
		||||
			(void)close (fd);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
#ifdef __APPLE__
 | 
			
		||||
	daemon_darwin();
 | 
			
		||||
#endif
 | 
			
		||||
	return (0);
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user