Skip to content

Instantly share code, notes, and snippets.

@rentalcustard
Created October 25, 2010 11:20
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rentalcustard/644805 to your computer and use it in GitHub Desktop.
Save rentalcustard/644805 to your computer and use it in GitHub Desktop.
Fix tmux bootstrap
--- server.c.orig 2009-09-20 11:11:24.000000000 -0700
+++ server.c 2009-09-30 23:20:05.000000000 -0700
@@ -34,6 +34,8 @@
#include <time.h>
#include <unistd.h>
+void *_vprocmgr_detach_from_console(unsigned int flags);
+
#include "tmux.h"
/*
@@ -146,8 +148,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");
logfile("server");
log_debug("server started, pid %ld", (long) getpid());
@dgoodlad
Copy link

Does this patch fix pasteboard interaction for you in Snow Leopard? It applies and compiles fine, and looks to be the appropriate change to make based on apple's patches to GNU Screen, but doesn't seem to have any effect for me.

@dgoodlad
Copy link

Never mind that; it works fine!

@rentalcustard
Copy link
Author

Updated gist with original author details and link to relevant MacPorts trac ticket for context. I'm glad this is useful, but I want neither the credit nor the blame!

@dgoodlad
Copy link

Thanks for letting me know; I've updated the pull request to homebrew with that info!

@ralph
Copy link

ralph commented Apr 3, 2011

I tried applying this patch to tmux 1.4, but no success. It compiles, but pbcopy still does not work. Any success messages out there?

@ralph
Copy link

ralph commented Apr 4, 2011

Thanks anyway :-/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment